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.
...Industries" tab. But the target audience for this report is not anyone that's going to filter anything.
Is there a way around this?
Thanks
'****************************************************************************
' Date : 2/26/08
' Author : Michael T. Smith
' File...
...(in case anyone is curious about the macro code that caused the original type mismatch error). The second is the macro code that now works.
'****************************************************************************
' Date: 2/26/08
' Author: Michael T. Smith
' Description...
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.