PC Review


Reply
Thread Tools Rate Thread

Create Excel Pivot tables from MS Access

 
 
chris
Guest
Posts: n/a
 
      4th Mar 2010
How can I create Excel Pivot tables from MS Access ?

Thanks a lot in advance.
 
Reply With Quote
 
 
 
 
RyGuy
Guest
Posts: n/a
 
      4th Mar 2010
Have you tried creating a crosstab query? That may do what you want. If you
want to control Excel, while inside Access, try this sub:

Option Compare Database
Option Explicit ' Use this to make sure your variables are defined
' One way to be able to use these objects throughout the Module is to
Declare them here, and not in a Sub
Private objExcel As Excel.Application
Private xlWB As Excel.Workbook
Private xlWS As Excel.Worksheet


Sub Rep()
Dim strFile As String
strFile = "C:\MyExcelWorkbook.xls"
‘Of course, this is just an example; put the actual path to your actual file
here…

' Opens Excel and makes it Visible
Set objExcel = New Excel.Application
objExcel.Visible = True

' Opens up a Workbook
Set xlWB = objExcel.Workbooks.Open(strFile)

' Sets the Workseet to the last active sheet - Better to use the commented
version and use the name of the sheet.
Set xlWS = xlWB.ActiveSheet

' Set xlWS = xlWB("Sheet1")
With xlWS ' You are now working with the Named file and the named worksheet

' Your Excel code begins here…you can record a macro and make the process
super easy!!

End With
' Close and Cleanup

xlWB.SaveAs xlSaveFile
xlWB.Close
xlapp.Quit
Set xlapp = Nothing

End Sub

Make sure to set a reference to Excel.

"chris" wrote:

> How can I create Excel Pivot tables from MS Access ?
>
> Thanks a lot in advance.

 
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
Embed OLE Excel Pivot Tables in Access Forms? Access v2003 and ff. John Microsoft Access Form Coding 0 30th Oct 2010 06:24 PM
Embed OLE Excel Pivot Tables in Access Forms? Access v2003 and ff. John Microsoft Access Form Coding 0 30th Oct 2010 05:59 PM
Excel should let me create pivot tables of non-numeric data. Geek4Life Microsoft Excel Misc 2 10th Aug 2009 04:12 PM
Create calculaed members in Excel 2007 Pivot tables Ecke Microsoft Excel Programming 0 26th May 2008 12:20 PM
Access to excel pivot tables =?Utf-8?B?UEI=?= Microsoft Access Reports 0 11th May 2006 12:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:14 PM.