How to create an empty Excel file ?

jvincent

Registered User.
Local time
Today, 19:53
Joined
Apr 30, 2005
Messages
99
Hello,
I would like to know how to create an empty Excel file (from Access) ?
I would like to name the workbook (xxx.xls) name the sheets and give the folder where to store it.
Thanks in advance for help.
VINCENT
 
why?

Search around for the issue to create excel files from VBA has been discussed.
 
Hi Ghudson,
I need to create an Excel doc with variable number of sheets , each sheet will correspond to a temperature statistic, of course after created the doc i will export data from Access. I searched 'EXCEL' but i only found exorts in an already existing Excel document, or maybe i misunderdstood the threads.
I will search in VBA forum.
Thks
 
Onceyou have your basic code for automating Excel you can create code in Xl using the macro recorder to find out how to add and name new sheets then adapt the recorded code for use from Access

Peter
 
Create blank excel sheet and document

In a nutshell, here's an example of how to do that through VBA..

dim m_objappexcel as new excel.application
dim m_objdatabook as excel.workbook
dim m_objdatasheet as excel.worksheet

'Creates a blank excel document
set m_objdatabook = m_objappexcel.workbooks.add
set m_objdatasheet1 = m_objdatabook.worksheet(1)
....(continue for other worksheets).....

'Create blank worksheet in excel
set m_objdatabook = m_objappexcel.workbooks.add (path/filename)
set m_objdatasheet1 = m_objdatabook.worksheets(1)
...(Contineu for other worksheets)...

Post again if you have any other questions...

Rob
 

Users who are viewing this thread

Back
Top Bottom