Hi all,
I've encountered the error message (in title). I tried searching the web for a solution but with no luck.
the code segment that receives the error:
when the "set pt= ..." gets highlightedPlease Login or Register to view this content.
Hi all,
I've encountered the error message (in title). I tried searching the web for a solution but with no luck.
the code segment that receives the error:
when the "set pt= ..." gets highlightedPlease Login or Register to view this content.
Last edited by OmerBD; 08-16-2018 at 04:36 AM. Reason: mistake
without having anything else to test
only two things to suggest
did you put in worksheet variable for loadport?? if not then replace with Worksheets("loadport")
try it without Version:=xlPivotTableVersion15
ALSO
Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Do you have any blank headers on the sheet, or invalid characters in row 1? Can you manually create a pivot table from the data on that sheet without getting the same error?
Rory
Ok So PT line instead of PC
PT line do you have a pivot table with that name already?
Hi humdingaling,
I made a mistake in my post.. the highlighted row is the "set pt = pc.create (etc')".
Thanks
TableName:="LPPivot"
you can only have one pivot table with the same name at one time
Does this return the range you expect:
Please Login or Register to view this content.
Try changing this:
to this:Please Login or Register to view this content.
If that doesn't work, I think we need to see a workbook.Please Login or Register to view this content.
I've changed it. appear to be working. but thegives me an error: "unable to get the PivotTables property of the worksheet class".Please Login or Register to view this content.
(I can leave the PT with the default style if it is a problem)
Much appreciation for the help!!
Last edited by OmerBD; 08-16-2018 at 08:26 AM.
Use pt instead of ActiveSheet.PivotTables("LoadPortPivot")
Glad to help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks