Macro Exports to Excel

I

ITperson

Hello

In Access 2002, I have a macro that runs a query to export the query results
to excel. The Export works, however, In my Excel template (.xlt file), I
have some code that will split the data into sheets and sort the sheets in
Alphabetic order.

In the Macro, I have the Output to option where I indicate where the
template file for excel is. Because I leave the Save file as option blank it
prompts me for a filename; which is fine.

Problem is, is when the macro runs, it creates the workbook and saves it and
opens it but there is none of the code I wrote in the excel template in the
file at all. Infact, there is no "Module1" (which I named the module that
contains the code).

Any suggestions as to what may be happening with my module in excel or even
how to resolve the issue?

Thank you
Terry
 
A

ami'n

Hello

In Access 2002, I have a macro that runs a query to export the query results
to excel.  The Export works, however, In my Excel template (.xlt file), I
have some code that will split the data into sheets and sort the sheets in
Alphabetic order.

In the Macro, I have the Output to option where I indicate where the
template file for excel is.  Because I leave the Save file as option blank it
prompts me for a filename; which is fine.

Problem is, is when the macro runs, it creates the workbook and saves it and
opens it but there is none of the code I wrote in the excel template in the
file at all.  Infact, there is no "Module1" (which I named the module that
contains the code).

Any suggestions as to what may be happening with my module in excel or even
how to resolve the issue?

Thank you
Terry

Can you give your file on how to export data from query to Excel? you
can email me
 
J

jversiz via AccessMonster.com

I know this is a work-around, but you could include in your Excel macro in
another file something that opens the file you just exported, edits the file,
and then closes it. Then make the Excel file with the macro part of your
access macro.

Regards,

James C.
EDI Analyst

ami'n said:
[quoted text clipped - 17 lines]
Thank you
Terry

Can you give your file on how to export data from query to Excel? you
can email me
 

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

Similar Threads


Top