I did stick with the RC referencing like you showed and it worked. Having other pivot table issues now that I may have to start another thread about but this at least working.
Thanks
NOTE: The following does work but it doesn't solve the problem as I want to dynamically set the SourceData value:
' ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
' "AllIndustries!R1C1:R12923C14").CreatePivotTable TableDestination:="", _
'...
That didn't seem to work. The entire line goes red again. I even changed it to:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
Sheets("AllIndustries").Range("A1:N12").CreatePivotTable _
TableDestination:="", TableName:="PivotTable1"...
The code below produces a compile error in the VBA macro builder window. The "red" error line is line 9 (starts with "ActiveWorkbook.PivotCaches...". I'm about 99% sure the problem is with my SourceData value and the range I'm attempting to set this to. Can anyone see anything wrong with this...
Ok I have zero Oracle experience. I use Crystal Reports and someone once came to my cube and installed some Oracle software on my machine and I could then connect to an Oracle database and build reports. I have no idea what the database version is that I was connecting to.
I do know that when...
I did copy the sheets and macro into a new workbook. The total size decreased to about what I expected (double the size of my raw data).
The workbook I had been working with must have gotten corrupted even though everything was working fine.
Thanks for all the help.
Thanks for the help ck1999 and PHV.
Below is hopefully a new more efficient version.
I do have a final question though. This workbook/macro basically does the following:
1)
Workbook exists with one tab of data that contains revenue data for about ten industries.
2)
Workbook exists with...
The first time I incorporated your code I attempted to incorporate it into my original "Auto_Run" procedure and it didn't work (apparently when I did that I left out the dim on the "dim fso"). I added the dim in this scenario and still got the a type mismatch error. Then after reading your...
Thanks but it didn't seem to work. Tested your recommendation - code I have is:
Dim sPath As String
sPath = "C:\Temp\Dougs Files Duns Load\ExcelLoading\CrExportdata.xls"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(sPath) Then
' Test...
I'm using Microsoft Excel 2003. I've played with this enought and can't figure it out...
Macro code is below. The very first thing my auto run macro does is check to see if a file exists. I'm testing it repeatedly with the file missing so Excel will shutdown (quit).
Each time this code...
Thanks for the help. The following worked and it didn't activate all the sheets unnecessarily as I was doing. Did make one change as I intended to copy a row not a column:
Sub EmptyWorksheets(IndWrkShtArr As Variant)
For i = 1 To UBound(IndWrkShtArr)
With Sheets(IndWrkShtArr(i))...
First question:
Does anyone have any recommended (free) sites that do a good job of teaching the object model? Something that starts at the newbie level and advances would be great. More interested in Excel than anything else.
I've Googled and found some stuff but was looking for input from...
Hi, I'm really new to Excel VBA programming and have the question below. I'm using Excel 2003 on a laptop.
I have the following procedure that is passed an array of worksheet names:
Sub EmptyWorksheets(IndWrkShtArr As Variant)
For i = 1 To UBound(IndWrkShtArr)
Sheets(i).Select...
First question:
Does anyone have any recommended (free) sites that do a good job of teaching the object model? Something that starts at the newbie level and advances would be great. More interested in Excel than anything else.
I've Googled and found some stuff but was looking for input from...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.