Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2003, 10:06 AM
Authorized User
 
Join Date: Sep 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Exporting to Excel

Hi!
Please, I would like to know if it is possible to export data from Access to an Excel file using

DoCmd.SendObject acSendQuery, "qryName", acFormatXLS, _
        cboRecipient, , , "Subject Line", _
        "Dear " & cboRecipient & ":" & Chr(10) & _
        "Comment to recipient" & _
        Chr(10) & Chr(10) & _
        "Thanks," & _
        Chr(10) & _
        cAuthor

but somehow alter the default of the file exported to Excel, such that the top row of the exported file (the header row) is not shaded grey? I think this must be the default setting when exporting queries. This is a user request...apparently the exported grey top row blends in with Excel's grey columns (A,B,C,etc..) and some of the recipients don't realize the top row is a header. Goofy huh!?! In any case, can anyone help me find a way to make the recipients happier? Any help would be greatly appreciated.

Thank you so much in advance

 
Old September 17th, 2003, 02:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you export it as a CSV? - most people have Excel as the default CSV handler, so they'd see an Excel icon for the file, which should please them.

HTH
Steven

I am a loud man with a very large hat. This means I am in charge
 
Old September 18th, 2003, 09:42 AM
Authorized User
 
Join Date: Sep 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Steven - Hi, thanks for the suggestion. I think that would workout perfectly if only I could do that through the code I used... The code below is how it gets exported to email - and acFormatXLS is the output format. acFormatCSV does not work, acFormatTXT does not work, as the end recipients are not the most computer literate to delimit the txt file.
But I thank you for the suggestion - is it possible that there is some other code I could write that would do what I am trying to accomplish, yet export it as a CSV??

Any help would be very much appreciated,
Sean

DoCmd.SendObject acSendQuery, "qryName", acFormatXLS, _
        cboRecipient, , , "Subject Line", _
        "Dear " & cboRecipient & ":" & Chr(10) & _
        "Comment to recipient" & _
        Chr(10) & Chr(10) & _
        "Thanks," & _
        Chr(10) & _
        cAuthor






Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting to excel michaeltanfeliz Beginning VB 6 2 May 3rd, 2008 05:26 AM
Exporting From Access To Excel jimnich Access VBA 17 February 8th, 2008 07:23 AM
exporting to excel caveatashish Classic ASP Basics 0 November 3rd, 2006 05:08 AM
Exporting to Excel JJ Access 1 June 9th, 2003 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.