[AccessD] Report to Excel_

Michael R Mattys mmattys at rochester.rr.com
Tue May 8 12:58:26 CDT 2007


Mark,

You could put most of your formatting in an xlt, but it's going
to take a bit of fancy automation to replicate your report.

Michael R. Mattys
MapPoint & Access Dev
www.mattysconsulting.com

----- Original Message ----- 
From: "Mark A Matte" <markamatte at hotmail.com>
To: <accessd at databaseadvisors.com>
Sent: Tuesday, May 08, 2007 12:55 PM
Subject: Re: [AccessD] Report to Excel_


> Thanks Jim,
>
> I need to export a report because of the conditional formatting.
> TransferSpreadsheet won't work with reports.
>
> Any thoughts?
>
> Thanks,
>
> Mark A. Matte
>
>
>>From: "Jim Hewson" <JHewson at karta.com>
>>Reply-To: Access Developers discussion and problem
>>solving<accessd at databaseadvisors.com>
>>To: "Access Developers discussion and problem
>>solving"<accessd at databaseadvisors.com>
>>Subject: Re: [AccessD] Report to Excel
>>Date: Mon, 7 May 2007 16:27:24 -0500
>>
>>Mark,
>>I do this frequently.  In one export I end up with 15 worksheets and
>>manipulate the date in Excel via Access.
>>
>>I would use TransferSpreadsheet instead of what you have.
>>Also, put   Set appExcel = New Excel.Application  before the
>>TransferSpreadsheet command.
>>
>>If you use something like:
>>
>>     DoCmd.TransferSpreadsheet acExport, , strReport1, strPathName, True
>>     DoCmd.TransferSpreadsheet acExport, , strReport2, strPathName, True
>>
>>It will export to separate spreadsheets.
>>
>>HTH
>>
>>Jim
>>jhewson at karta.com
>>
>>
>>-----Original Message-----
>>From: accessd-bounces at databaseadvisors.com
>>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
>>Sent: Monday, May 07, 2007 4:00 PM
>>To: accessd at databaseadvisors.com
>>Subject: [AccessD] Report to Excel
>>
>>Hello All,
>>
>>I found the code below in the archives from Jim Hale...Anyway to use this
>>approach but to have 2 reports go to the same workbook...just different
>>tabs?
>>
>>Thanks,
>>
>>Mark A. Matte
>>
>>*********Code From Jim****************
>>Sub rpt_to_excel()
>>Dim appExcel As Excel.Application, strpathname As String Dim strpathnew
>>As String, strReport As String
>>
>>strpathname = "C:\test.xls"
>>strpathnew = "C:\test2.xls"
>>strReport = "rptInvsummary"
>>DoCmd.OutputTo acOutputReport, strReport, acFormatXLS, strpathname
>>
>>Set appExcel = New Excel.Application
>>
>>'format your report
>>     With appExcel
>>         .Workbooks.Open strpathname, 0
>>         .Visible = True 'just to watch the sheet
>>         .Range("A1:G1").Select
>>         .Selection.Font.Bold = True
>>         .Selection.Font.Name = "Arial"
>>         .Selection.Font.Size = 12
>>         .ActiveWorkbook.SaveAs Filename:=strpathnew,FileFormat:=xlNormal
>>     End With
>>      appExcel.Quit
>>     Set appExcel = Nothing
>>End Sub
>>
>>_________________________________________________________________
>>Download Messenger. Join the i'm Initiative. Help make a difference today.
>>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
>>
>>
>>--
>>AccessD mailing list
>>AccessD at databaseadvisors.com
>>http://databaseadvisors.com/mailman/listinfo/accessd
>>Website: http://www.databaseadvisors.com
>
> _________________________________________________________________
> Make every IM count. Download Messenger and join the i'm Initiative now.
> It's free. http://im.live.com/messenger/im/home/?source=TAGHM_MAY07
>
>


--------------------------------------------------------------------------------


> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list