Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Formatting lost when exporting from Access to Excel template

Posted on 2013-11-06
2
Medium Priority
?
907 Views
Last Modified: 2013-11-11
I am using TransferSpreadsheet in Access 2010 to export data from a pass through query to an Excel worksheet which has been preformatted with specific colors, column sizes, etc.  This usually works fine but sometimes the formatting is not preserved.  Is there anything I can do to guarantee that the formatting will not be changed?

Note:  I use vba code which always runs the TransferSpreadsheet the exact same way, exporting to the same target worksheet and the same range name.
0
Comment
Question by:DrLechter
  • 2
2 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39628801
The transfer spreadsheet command itself gives you no control over the formatting.

You can use Excel Automation (VBA) to format Excel sheets after running Transfer Spreadsheet... or even use automation for the whole thing - Export and formatting.

The upside is that it is essentially opening Excel from Access, giving you all of the bells and whistles that Excel offers through programming.  The downside is that it can be very code intensive, with a significant learning curve.
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 39628807
Take a look at the HiTechCoach's site here:
http://www.hitechcoach.com/index.php?option=com_weblinks&view=category&id=84%3Aaccess-vba-office-automation&Itemid=23

The top two articles in the list will give you an idea of how automation works... importing and exporting.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question