Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I would like to create a new excel file from scratch using VBA. Here's what I got so far Dim xlApp As Excel.Application, xlBook As Excel.Workbook, xlSheet As Excel.Worksheet Set xlApp = CreateObject("excel.application") Set xlBook = xlApp.Workbooks.Open("c:\test.xls", 0, False, 2) Set xlSheet = xlBook.Worksheets(1) Now that is to create a new excel file from and existing on "test.xls". How would I do it to create one without having an existin one. Something like Set xlBook = xlApp.Workbooks.New ?? thank -- FrankAlv ----------------------------------------------------------------------- FrankAlva's Profile: http://www.excelforum.com/member.php...fo&userid=1620 View this thread: http://www.excelforum.com/showthread.php?threadid=27720 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Frank,
Have you tried Set xlBook = xlApp.Workbooks.Add(Template:="Workbook") -- HTH RP (remove nothere from the email address if mailing direct) "FrankAlva" wrote in message ... Hi, I would like to create a new excel file from scratch using VBA. Here's what I got so far Dim xlApp As Excel.Application, xlBook As Excel.Workbook, xlSheet As _ Excel.Worksheet Set xlApp = CreateObject("excel.application") Set xlBook = xlApp.Workbooks.Open("c:\test.xls", 0, False, 2) Set xlSheet = xlBook.Worksheets(1) Now that is to create a new excel file from and existing one "test.xls". How would I do it to create one without having an existing one. Something like Set xlBook = xlApp.Workbooks.New ?? thanks -- FrankAlva ------------------------------------------------------------------------ FrankAlva's Profile: http://www.excelforum.com/member.php...o&userid=16208 View this thread: http://www.excelforum.com/showthread...hreadid=277200 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where should this code go? In an existing Excel file, xla file, or xlt file?
"Bob Phillips" wrote: Frank, Have you tried Set xlBook = xlApp.Workbooks.Add(Template:="Workbook") -- HTH RP (remove nothere from the email address if mailing direct) "FrankAlva" wrote in message ... Hi, I would like to create a new excel file from scratch using VBA. Here's what I got so far Dim xlApp As Excel.Application, xlBook As Excel.Workbook, xlSheet As _ Excel.Worksheet Set xlApp = CreateObject("excel.application") Set xlBook = xlApp.Workbooks.Open("c:\test.xls", 0, False, 2) Set xlSheet = xlBook.Worksheets(1) Now that is to create a new excel file from and existing one "test.xls". How would I do it to create one without having an existing one. Something like Set xlBook = xlApp.Workbooks.New ?? thanks -- FrankAlva ------------------------------------------------------------------------ FrankAlva's Profile: http://www.excelforum.com/member.php...o&userid=16208 View this thread: http://www.excelforum.com/showthread...hreadid=277200 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is it possible to create a hyperlink in excel to a pdf file? | Excel Worksheet Functions | |||
How do i create an excel file using asp | Excel Discussion (Misc queries) | |||
Create a batch file from a number of Excel File | Excel Programming | |||
Create PDF from Excel File | Excel Programming | |||
VB.Net: Create Excel File/App? | Excel Programming |