Designating Spreadsheet Names in a Workbook Using Access VB

T

Tony

I'm trying to export the results of a query to an Excel
spreadsheet. Both TransferSpreadsheet and OutputTo work
fine for that. I can also export to a pre-exisiting
workbook using these methods.

But on the second time I export to the same workbook, my
first export is overwritten. I can avoid this by changing
the name of the spreadsheet (or tab) in the Workbook. But
I have not been successful in doing this in VB code. I've
used the following code:

Sheets("sheet1").Name = "test"

But get the error message below:

Error is Run time error 1004
Method 'Sheets' of Global_Failed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top