G
Guest
Hi all,
I'm having a small issue with Excel after I've run some code in Access 97
and I don't know what the cause of it is. Maybe someone can see what's
causing it.
In code, I create Excel Application, Workbook and Worksheet(2).
I delete and add some sheets.
I then copy values from the results of a SQL string (using recordset) to a
worksheet.
The I create a pivot table and place it in a new worksheet.
After all that it created, I use XlApp.Visible. = True and the workbook
appears in Excel (as a default workbook name, ie Book2). Everything up to
this point works great.
Here's where the issue appears. After I'm all done, and have closed Access
and Excel, if I open another file, Excel opens that file and another blank
workbook (with dfault workbook name), however, it's got the two sheets I
added and it's missing the sheets I deleted (which are the default Shee1,
Sheet2, Sheet3).
And if I open Excel using a shortcut or Programs menu, it opens the regular
blank workbook, with default sheets.
The call to Excel and the remaing code is as follows:
xlApp.Visible = True
Set xlApp = Nothing
Set xlWbk = Nothing
Set xlWshtData = Nothing
Set xlWshtPivot = Nothing
My database and recordsets are all closes before this code. I don't know
what could be causing the problem. Is there something in Excel I've changed?
I'm willing to post the code if anyone needs it to see what I've done.
It doesn't happen on other people's PCs when they open the Access file.
Any help is appreciated, as I'm stuck!
Thanks,
Jay
I'm having a small issue with Excel after I've run some code in Access 97
and I don't know what the cause of it is. Maybe someone can see what's
causing it.
In code, I create Excel Application, Workbook and Worksheet(2).
I delete and add some sheets.
I then copy values from the results of a SQL string (using recordset) to a
worksheet.
The I create a pivot table and place it in a new worksheet.
After all that it created, I use XlApp.Visible. = True and the workbook
appears in Excel (as a default workbook name, ie Book2). Everything up to
this point works great.
Here's where the issue appears. After I'm all done, and have closed Access
and Excel, if I open another file, Excel opens that file and another blank
workbook (with dfault workbook name), however, it's got the two sheets I
added and it's missing the sheets I deleted (which are the default Shee1,
Sheet2, Sheet3).
And if I open Excel using a shortcut or Programs menu, it opens the regular
blank workbook, with default sheets.
The call to Excel and the remaing code is as follows:
xlApp.Visible = True
Set xlApp = Nothing
Set xlWbk = Nothing
Set xlWshtData = Nothing
Set xlWshtPivot = Nothing
My database and recordsets are all closes before this code. I don't know
what could be causing the problem. Is there something in Excel I've changed?
I'm willing to post the code if anyone needs it to see what I've done.
It doesn't happen on other people's PCs when they open the Access file.
Any help is appreciated, as I'm stuck!
Thanks,
Jay