Hi All
I have a button in access application which will export the data from the table to te excel.Now what i want is that, i need the header columns in the excel file need to be formatted to bold.How can i do this.This is my code but in the second line i am getting error saying "Application object not defined".
Can any one help.Thanks in advance
DoCmd.OutputTo acOutputQuery, "ExportDailySheetToExcel", acFormatXLS, "ExportDailySheetToExcel.xls", True
the first line code exports to excel , the second line i used to format the excel headers.What is the problem with below line
Range("A1:Z1").Font.Bold = True
6 1894
Hi
Thanks for the reply.but i have excel file application open with my first statement itself.
DoCmd.OutputTo acOutputQuery, "ExportDailySheetToExcel", acFormatXLS, "ExportDailySheetToExcel.xls", True
the above stmts creates the excel file named ExportDailySheetToExcel
now i want the headers of that excel file need to be formated
Please help me.
Thanks in advance
You have no excel application open.
Look at application automation.
Hi
Thanks for the reply.but i have excel file application open with my first statement itself.
DoCmd.OutputTo acOutputQuery, "ExportDailySheetToExcel", acFormatXLS, "ExportDailySheetToExcel.xls", True
the above stmts creates the excel file named ExportDailySheetToExcel
now i want the headers of that excel file need to be formated
Please help me.
Thanks in advance
No, you don't have an excel application open.
OutputTo creates an excel document but it does not keep open the excel application. It may not even need to open an excel application. And even if it did, it does not return an application object for you to use.
Hi
Thanks for your valuable comments.So please suggest what will be code to attain my objective..
on button click event
i have this code
DoCmd.OutputTo acOutputQuery, "ExportDailySheetToExcel", acFormatXLS, "ExportDailySheetToExcel.xls", True
now what code should i write to attain my objective
Thanks in advance
Dilip
No, you don't have an excel application open.
OutputTo creates an excel document but it does not keep open the excel application. It may not even need to open an excel application. And even if it did, it does not return an application object for you to use.
Read the application automation tutorial linked above. That will get you started.
Thanks for that..I will surely go with automation link if i face any difficult will surely post you
Read the application automation tutorial linked above. That will get you started.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Allison Bailey |
last post by:
Hi Folks,
I'm a brand new Python programmer, so please point me in the right
direction if this is not the best forum for this question....
I would like to open an existing MS Excel spreadsheet...
|
by: Igor |
last post by:
Hi everyone!
I have a question about exporting data to Microsoft Excel.
I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but...
|
by: Mustufa Baig |
last post by:
Hi everybody,
I have an ASP.NET website where clients can view their monthly billings by
selecting different options. One of the option is the way they want to see
the report i.e. whether they...
|
by: |
last post by:
Hello,
I have a routine in my Windows application that exports the contents of a
datagrid to Excel. It is modeled closely after the HowTo example on MSDN:
http://tinyurl.com/5g2jm.
Depending...
|
by: Kevin Humphreys |
last post by:
Hi There,
I am trying to export a recordset to an excel file using the Content Type
below in the header.
Response.ContentType = "application/vnd.ms-excel"
Which works fine however the...
|
by: ggupta78 |
last post by:
Hi,
Currently in our application we use the MHTML way of exporting to Excel
i.e we render the datagrid HTML and set the MIME type to Excel.
This works great but has the following limitation:
1....
|
by: Mad Scientist Jr |
last post by:
>From an asp.net web page I want the user to open the results of a SQL
query in Excel, as automatically as possible (ie not having to loop
through columns, rows, in code).
For this,...
|
by: Dirk Hagemann |
last post by:
Hello,
From a zone-file of a Microsoft Active Directory integrated DNS server
I get the date/time of the dynamic update entries in a format, which
is as far as I know the hours since january 1st...
|
by: TG |
last post by:
hi!
I am trying to create a sql server table from an excel sheet.
Here is the code I have:
'This procedure the xlsx file and dumps it to a table in SQL Server
|
by: K Viltersten |
last post by:
I understand that the new versions of MS
Word, MS Excel etc. allow for creation of
a document using XML tags (the technique
or format is called OOXML, i think).
I imagine that the idea behind...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |