Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Access Create Excel Pivot Table Data Source

I am currently using an Access Frontend with Tables to create several
Excel Pivot tables and charts. Everything is working great but I was
wanting to simplify the code a little if possible. Here is the code
snippit I am looking at changing:

MyDataSetConn = "ODBC;DSN=MS Access Database;" & _
"DBQ=" & datasetpath & "\" & datasetDB & ";" & _
"DefaultDir=" & datasetpath & ";" & _
"DriverId=25;" & _
"FIL=MS Access;" & _
"MaxBufferSize=2048;" & _
"PageTimeout=5)"

With newbook.PivotCaches.Add(SourceType:=xlExternal)
.Connection = MyDataSetConn
.CommandType = xlCmdSql
.CommandText = "SELECT " & _
"IPO_History_tbl.IpoDate, " & _ etc.

The Datasetpath and datasetDb are located in the Access file that this
code is running from. I don't like to hardcoat the paths. I do
suppose that I could get the file path but I would like to go one step
further. Can the .PivotCaches.Add, Point to itself? Why go through
the ODBC connection when the Data is in the current Access file.
Could I do something like this :

Get rid of the "MyDataSetConn =" section and

With newbook.PivotCaches.Add(SourceType:=internal)
.CommandType = xlCmdSql
.CommandText = "SELECT " & _
"IPO_History_tbl.IpoDate, " & _ etc.

Any help would be greatly appreaciated.

Thank you,

Darren

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table external XLS file source change and GETPIVOTDATA refresh mbobro Excel Discussion (Misc queries) 0 July 8th 06 12:45 PM
Linking parameter query from Access to pivot table in Excel ken1975 Excel Discussion (Misc queries) 2 June 20th 06 01:51 PM
Show text data in excel pivot table Kathy Kirk Excel Discussion (Misc queries) 2 January 10th 06 01:26 PM
pivot table sort entries that don't yet appear in table rachael Excel Discussion (Misc queries) 11 September 19th 05 11:29 PM
How do I create a pivot table from multiple pages of data? PT Cruiser Excel Worksheet Functions 3 August 19th 05 08:41 PM


All times are GMT +1. The time now is 09:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"