Solved

Formatting lost when exporting from Access to Excel template

Posted on 2013-11-06
2
826 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 500 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

803 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