By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Create Excel Doc with Access VBA

P: n/a
I have written code to transfer a table to an Excel document.
However, I do not know the code to add some "bells and whistles" to
the document. Can someone direct me to a reference on the Internet
that I can use for what more can be done?
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
What I've done in the past is simply use Excel's macro recording
feature to get the properties and methods I needed.

One important caution, though: the generated maros will have
"implicit references" to Excel objects. These can cause the infamous
"Excel process still running in Task Manager" problem if they're
simply pasted into an Access VBA module without modification.

-Matt

On 10 Sep 2004 13:25:40 -0700, pw****@hotmail.com (Paul) wrote:
I have written code to transfer a table to an Excel document.
However, I do not know the code to add some "bells and whistles" to
the document. Can someone direct me to a reference on the Internet
that I can use for what more can be done?


Nov 13 '05 #2

P: n/a
pw****@hotmail.com (Paul) wrote in message news:<b8**************************@posting.google. com>...
I have written code to transfer a table to an Excel document.
However, I do not know the code to add some "bells and whistles" to
the document. Can someone direct me to a reference on the Internet
that I can use for what more can be done?


1. define "bells and whistles"
2. play with Excel Macros
3. Check the Excel NG
Nov 13 '05 #3

P: n/a
> 1. define "bells and whistles"
2. play with Excel Macros
3. Check the Excel NG


Sorry, I should have defined "bells and whistles". From my VBA code I
can resize the columns to AutoFit. I want to do other formatting like
making the header row bold, add additional tabs to the Excel document,
etc. Below is the code so far.

You know when you press the period (".") on a control it will pop up
the methods and properties for that control. I do not get that to
give me the properties that I can change.

I would like a website that would show the properties that I can use.
Anybody know of a good one?

CODE:
----------

DoCmd.TransferSpreadsheet acExport,
acSpreadsheetTypeExcel9,
"DailyFollowUpForCash",
"H:\Temp\DailyFollowUpForCash.xls",
True
Set objExcelApp = CreateObject("Excel.Application")
objExcelApp.workbooks.Open "H:\Temp\DailyFollowUpForCash.xls"
objExcelApp.Visible = False
objExcelApp.Columns("A:G").EntireColumn.AutoFit
objExcelApp.ActiveWorkbook.Save
objExcelApp.workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.