Access Macro Problem

B

Ben Webber

Hi,

I've got a simple Access Macro that uses the TransferSpreadsheet Action to
export a number of tables into Excel. The problem is that the results include
one more spreadsheet than is in the macro. The extra resulting spreadsheet
was in the macro at one time.

In my unsophisticated brain, this tells me that the wysiwyg macro tool is
showing me something different from underlying code. Is there a way for me to
see the code (hopefully VB) behind the macro? Is there something else I can
try?

Thanks in advance,
 
6

'69 Camaro

Hi, Ben.

Unfortunately, you can't see the code behind the macro, nor can you do any
debugging or error handling with macros.

But the macro may not be to blame. Does the spreadsheet already exist
before the macro is run? If so, then the extra worksheet from the table that
was deleted from the macro was created on an earlier execution of the macro.
This spreadsheet is not deleted or overwritten by the most recent execution
of the macro.

To get rid of this old table data in the Excel file, you will have to
manually delete the extra worksheet or delete the file (but only delete the
file if you don't have other worksheets in the file and have not customized
the Excel file), and then run the macro again. The macro will create the
Excel spreadsheet if it doesn't already exist, then populate it with the
worksheets from the data in the tables that you currently have listed in the
macro.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. (Only "Answers" have green
check-marks.) Remember that the best answers are often given to those who
have a history of rewarding the contributors who have taken the time to
answer questions correctly.
 
Top