473,322 Members | 1,259 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,322 software developers and data experts.

Create Excel Doc with Access VBA

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
3 11456
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
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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Martin | last post by:
I have a situation where I'm displaying some information in a table on a web page. I've given the user the ability to make several different "queries" and show different sub-sets of the data. I...
0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
1
by: tkaleb | last post by:
I have to create output file in a text, MS Access, MS Excel and .dbf format from C# Win/ADO.NET application. Data are collected in DataSet and there is no problem to make text file. However, I have...
6
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
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...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
0
by: Steve1974 | last post by:
Hi All I am currently using Access to output to excel. The creation of the worksheet goes ok, and then I have a piece of code (recorded from an Excel macro) to create pick lists for two columns...
0
by: FireGeek | last post by:
I need to create a new Access table with columns based on an Excel file. More Information: This task will come before I actually import the Excel file data into my data base. This Excel file...
2
by: LittlePhil via AccessMonster.com | last post by:
Someone please help before i start to cry. I'm trying to export from Access to Excel, then create a new excel sheet with a pivot table to display the data held in columns A:P. I get the error...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.