7 Replies - 1748 Views - Last Post: 07 May 2013 - 09:39 AM Rate Topic: -----

#1 kentlucky  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 74
  • Joined: 20-June 12

Creating xls file using vb6

Posted 05 May 2013 - 06:10 AM

I am always creating programs that puts data to xls files just simple xls files without any merging.
but this is the first time that I have to create a program that puts data with so many merging in the header.

My problem there is I don't know on how to create this xls file with this header format. is it Possible that I can create a program that really looks like the header format in vb6?
I want to create a program that create xls files and puts data in to it. and It is really required for me to make my created xls files looks like on how in the image shown..
i have attached here the sample xls file that I want to create.

Its a big help for me if you have some ideas to share.

Thank you.

Is This A Good Question/Topic? 0
  • +

Replies To: Creating xls file using vb6

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,353
  • Joined: 12-December 12

Re: Creating xls file using vb6

Posted 05 May 2013 - 08:42 AM

There is no file or screenshot attached to your post.

In the meantime, do you know how to record macros in Excel? Use this to your advantage!
Was This Post Helpful? 0
  • +
  • -

#3 kentlucky  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 74
  • Joined: 20-June 12

Re: Creating xls file using vb6

Posted 05 May 2013 - 11:02 AM

Sorry.. here is the sample file

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,353
  • Joined: 12-December 12

Re: Creating xls file using vb6

Posted 05 May 2013 - 11:23 AM

Your description confuses me. Are you looking to recreate the look of that file on a VB6 form, or perhaps a report? Or are you looking to use VB6 to create an Excel workbook?

If the second choice, you could manually create the Excel file as a template, and just create a new workbook based on this template each time; then you would only need to fill in the data, as the formatting will already be in place. Or, as I mentioned, make good use of the macro recorder in Excel to obtain the code that you need to format the workbook/sheet in the way that you want.

If you don't already know how to record a macro in Excel I suggest that you take the time to learn how, as it will be very difficult for you otherwise to find the code that you need to achieve this formatting.
Was This Post Helpful? 1
  • +
  • -

#5 kentlucky  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 74
  • Joined: 20-June 12

Re: Creating xls file using vb6

Posted 05 May 2013 - 11:38 AM

Thanks for the help.

Quote

you could manually create the Excel file as a template,

I will follow this idea that you gave.. I know its a big help for me because this is needed this afternoon.
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,353
  • Joined: 12-December 12

Re: Creating xls file using vb6

Posted 05 May 2013 - 12:01 PM

View Postkentlucky, on 05 May 2013 - 06:38 PM, said:

Thanks for the help.

Quote

you could manually create the Excel file as a template,

I will follow this idea that you gave.. I know its a big help for me because this is needed this afternoon.

Create the template with all the required formatting, save it with extension .xlt (or .xltx), possibly in a shared location, then use:

Workbooks.Add("Path to shared folder\thetemplate.xltx")
'and ..
ActiveWorkbook.SaveAs "some other path and filename.xls(x)"
'(or workbookReference.SaveAs "...")

Was This Post Helpful? 0
  • +
  • -

#7 kentlucky  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 74
  • Joined: 20-June 12

Re: Creating xls file using vb6

Posted 07 May 2013 - 09:38 AM

Thank you so much for the help. I've already finish my program and it works perfectly :)
Was This Post Helpful? 0
  • +
  • -

#8 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,353
  • Joined: 12-December 12

Re: Creating xls file using vb6

Posted 07 May 2013 - 09:39 AM

View Postkentlucky, on 07 May 2013 - 04:38 PM, said:

Thank you so much for the help. I've already finish my program and it works perfectly :)

You are welcome. Andy.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1