473,398 Members | 2,212 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,398 software developers and data experts.

Excel Format

46
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
Dec 13 '07 #1
6 1894
Rabbit
12,516 Expert Mod 8TB
You have no excel application open.

Look at application automation.
Dec 13 '07 #2
ramdil
46
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.
Dec 14 '07 #3
Rabbit
12,516 Expert Mod 8TB
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.
Dec 14 '07 #4
ramdil
46
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.
Dec 17 '07 #5
Rabbit
12,516 Expert Mod 8TB
Read the application automation tutorial linked above. That will get you started.
Dec 17 '07 #6
ramdil
46
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.
Dec 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

13
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...
5
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...
2
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...
3
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...
6
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...
3
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....
2
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,...
18
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...
7
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
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
tracyyun
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...

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.