473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Format Excel worksheet from inside Access 2003 application

Hi everyone,

Looking for some help or ideas, on the folloiwng problem.

Have an Access 2003 application that creates an Excel file containing
data from an Access parameter query. This is accomplished with the
following line:

DoCmd.TransferSpreadsheet acExport, , "MyQuery", "ExcelFileName", True

That's the easy part. The problem is, the audience this Excel file is
intended for requires the workbook created by the above line to not
only contain the proper data (provided by the query), but also, for
the worksheet containing that data to be formatted in a specific way.

I would like to be able to write some VBA code to format the worksheet
to the required specs. The actual code that does the formatting can be
easily created by recording the steps of a macro in Excel while I
format the sheet as desired. Now, I would like to be able to run that
code from inside Access, right after the above line
(DoCmd.TransferSpreadsheet acExport....) runs.

1) Ideally, I would like Access itself, via the VBA code, to
manipulate (format) the Excel sheet just created, so this could happen
in any computer, whether Excel is installed in it or not. Is this
possible? How?

2) If that is not possible, and Excel NEEDS to be launched from the
Access VBA code to achieve this, can it be done in a completely silent
mode, so the Access application user is not aware that Excel launched,
formatted a sheet and closed? If that is the only manner to achieve my
goal, how can this be accomplished?
Nov 11 '08 #1
1 3709
"Joe Humburg" <Jo*@humburg.netwrote in message
news:tg********************************@4ax.com...
Can't thank you enough for your extremely fast and detailed response,
Keith. Will give it a try right away.

Thanks !!!!!!!
No problem, hope it helps.

Keith.
www.keithwilby.co.uk

Nov 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
4
by: BerkshireGuy | last post by:
I have the following Access code that exports to Excel, inserts a title, changes the color of the title, and then changes the format of several columns to currency. The following code sometimes...
9
by: Anthony | last post by:
To me, creating Excel 2003 spreadsheets programmatically via VB.NET hasn't really changed since the days of VB6. That is, I'd do something similar to this Code: Dim ExcelApp As...
3
by: James Wong | last post by:
Dear all, I have an old VB6 application which can create and access Excel object. The basic definition statements are as follows: Dim appExcel As Object Dim wkb1 As Excel.Workbook Dim wks1...
8
by: Sam | last post by:
Hi All, I posted this message few days ago. No one has answered so far. I just would like to know if it is possible to do or not. Even if you can not tell me how to do this, maybe you know which...
3
by: dan_roman | last post by:
Hi, I developed a script with a nice interface in Tkinter that allows me to edit some formulas and to generate an Excel worksheet with VBA macros within it. The script runs perfectlly in Office...
2
by: sherifffruitfly | last post by:
Hi, I'm using an adaptation of excel-reading code that's all over the internet - I don't much like or understand it, but it has worked for me in the past.... beggars can't be choosers... : ...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
6
by: and1 | last post by:
hello .. hmm currently i'm working on vba in excel, apparently i use ADO to extract a table data from access to excel and it works fine. the problem is when i use the extracted data to create a chart...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.