PC Review


Reply
Thread Tools Rate Thread

Code to export report to Excel & keep settings

 
 
Pamela
Guest
Posts: n/a
 
      30th Jul 2009
I created a cmd button using the wizard to send the specified report. We
then choose Excel as the format/program to write it and it automatically
opens Outlook at attaches our report as a spreadsheet to a New Message. The
spreadsheet version of our report, however, doesn't keep the landscape
setting. I tried searching for help on it and found some code that looked
similar to what I am trying to accomplish and pasted it into my OnClick
event, but it isn't working...Please Help!! How can I do this all
automatically?? Thanks so much!

Here's is my code:
Private Sub MailtoTim_Click()
On Error GoTo Err_MailtoTim_Click

Dim stDocName As String

stDocName = "rpt_OpenAssnsAll"
DoCmd.SendObject acReport, stDocName
appxls.ActiveSheet.PageSetup.PrintArea = ""
With appxls.ActiveSheet.PageSetup
.Orientation = xlLandscape
End With


Exit_MailtoTim_Click:
Exit Sub

Err_MailtoTim_Click:
MsgBox Err.Description
Resume Exit_MailtoTim_Click

End Sub

Thanks again!
Pamela

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to export report to PDF automatically? Joseph Greenberg Microsoft Access Reports 2 1st Dec 2009 09:01 PM
Access to Excel 2000 Report Export with Code Bunert Microsoft Access Form Coding 0 27th Nov 2006 08:53 PM
Export report to excel ... getting subreports, but not MAIN report jmacleve Microsoft Access Reports 0 19th Jul 2005 08:53 PM
Export of Report Drops Code =?Utf-8?B?dHlyZHJhbm5veQ==?= Microsoft Access 3 10th Aug 2004 09:53 AM
Export Report to PDF code PAt G Microsoft Access Reports 4 7th Apr 2004 03:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.