Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOCK EXCEL FORMAT WHEN IMPORTING ACCESS DATA 1

Status
Not open for further replies.

pspring1

IS-IT--Management
Jan 21, 2005
13
CH
I am exporting data to Excel from a Macro I created in Access. Everytime I export the report, query, or table it rewrites the file or basically replaces it. For example the macro in Access is set to export to the Excel file called “TEST.xls” The problem is that I constantly import new raw data and run it through my macro in accessand then when it comes time to export it to excel through the Macro is just replaces the file.

The problem with it replacing the file is that I need to make formatting changes, to the excel file after it is exported so everytime I have to make these changes because they are constantly deleted. Is there a way to created an excel file template with a certain format (borders, shading, size of cells) that my macro in access could constantly export to and not have it replace the file with a new one? I basically want to set up an excel file with a certain format and contantly export and replace data in it and have it in the format I specified. I have not found a way to keep my excel file from being replaced when I do this or write to an existing excel file while preventing formatting changes or data from being deletd after I export my data from access into it.
 
Can't do it via standard exporting in access

CAN do it via either creating an excel template and just copying the data into that AFTER the export (this can be done manually or via code) OR you can export the query entirely by code & as part of that you can open either a template or blank file and paste it directly into that...

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
thanks for the reply, sp basicxally i have to create a template in excel - but export the access data to a different file in excel and then cut and paste that excel data into my template? I don't know code so is this my best option?
 
If you don't know code then yes - that would be your best option

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top