tags:

views:

590

answers:

1

Hi all, How to create an excel file using vbscripts.I had searched the net but just it mentions about opening the existing file using vb scripts. This is the extraction from the Internet shown below

Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\New_users.xls")

I want to know how do u create a new excel file or .xls using vb scripts .

Thanks and regards Maddy

+1  A: 

Here is a sample code

strFileName = "c:\test.xls"

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True

Set objWorkbook = objExcel.Workbooks.Add()
objWorkbook.SaveAs(strFileName)

objExcel.Quit

Edit: Check this link for more information

Shoban
Thanks a lot shoban.Can u suggest me a better link where we could learn vb scripting
Added a link for you Maddy.
Shoban
Thanks a lot shoban