Excel

  • Thread starter Thread starter nath
  • Start date Start date
N

nath

I am trying to open an excel workbook as an object from
Access. using set xl = createobject("Excel.application")

this works fine, how ever, i need to add and rename sheets
within this book.

i have tried.

xl.activeworkbook.sheets.add

but i cant get it to work.

any ideas.

TIA

Nath
 
Nath,

Try opening a workbook first and then adding to that. I am not too sure if
creating the Excel Application using CreateObject automatically creates a
new workbook (think this is why you are having a problem).

HTH,

Neil.
 
The CreateObject method will start EXCEL, which I believe always starts with
a blank workbook (no saved name).

Check the EXCEL newsgroups for more details, but here is how you add a new
workbook:

xl.Workbooks.Add
 
Back
Top