Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Redefining pivot table source

Good day all.

I have a pivot table within an Excel file that picks up its data from an
Access database located
in the same directory as the Excel file. I am attempting, unsuccessfully, to
change the source that the Excel file goes to when it picks up the data.
(Essentially, I am moving a folder from the C drive to the D drive.

The Access file is called "Figs2.mdb", the table within the Access file is
called "figstb" and the columns I am trying to retrieve from the table are
"Name", Location", "Date" and "Amount".

Code snip.......

----
Workbooks.Open ThisWorkbook.Path & "\NewPV.xls"
Set wb = ActiveWorkbook
x = ThisWorkbook.Path
y = x & "\Figs2.mdb"
wb.Sheets(1).PivotTableWizard SourceType:=xlExternal,
SourceData:=Array("SELECT figstb.Name, figstb.Location, figstb.Date,
figstb.Amount" & Chr(13) & "" & Chr(10) & "FROM `" & x & "\Figs2`.figstb
figstb"), _
Connection:=Array("ODBC;DSN=MS Access Database;DBQ=" & y & " ;FIL=MS
Access;")
----

Any help gratefully received. Thanks in advance.




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
Excel 2007 pivot table source table sb Excel Discussion (Misc queries) 1 August 21st 09 12:18 AM
entry removed from source table remains in pivot table pull down EL in Melb. Excel Worksheet Functions 1 September 6th 06 07:59 AM
Transforming pivot table back to the source table Frile Excel Worksheet Functions 0 February 14th 06 08:54 AM
OfficeXP "Cannot open pivot table source file" when refreshing pivot table Luc Alquier Excel Programming 2 December 9th 03 11:11 PM
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" Diana[_5_] Excel Programming 0 August 21st 03 10:19 PM


All times are GMT +1. The time now is 07:54 AM.

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

About Us

"It's about Microsoft Excel"