Hi,
My code just seems to error out on this line of code:
Capture.PNG
The error message I get is
Capture.PNG
Can anyone please help me?
Thanks in advance!
Hi,
My code just seems to error out on this line of code:
Capture.PNG
The error message I get is
Capture.PNG
Can anyone please help me?
Thanks in advance!
Hi,
Rather than
.RefreshTable
try just
.Refresh
Personally I prefer to use the Sheet VBA codename rather than the sheet tab name. I'm assuming the tab name you show is valid.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
I tried using just .Refresh and now I get the following error:
Capture.PNG
I'd say if anything were misspelled it would be the PivotTable name. If the sheet name were incorrect then the previous line would have thrown up an error, wouldn't it?
Just tested it and if the PT name is incorrect in the VBA then I get that same error message.
Maybe, record a macro of you refreshing the table and see what the line of code is there.
BSB
If the PivotTable name is correct in your code then may be helpful to upload the file so we can take a look.
BSB
Re #3.
I'm assuming you have just one workbook open and the 'ThisWorkbook' object is therefore the same as the 'Activeworkbook'. i.e. you haven't got a line of code somewhere which has activated a second workbook.
In that case and since w're agreed the sheet name is correct then the only other object in that line of code is the Pivot Table.
its weird because since encountering the first error message, I noticed this line of code (i.e. the one that activates the sheet) no longer works.
Its like somehow VBA has lost connection with the spreadsheet - which is quite strange because this same piece of code sometimes odes work but fails at a more later stage with an error message saying "object lost connection with its clients".
Attachment 660369
its frustrating I cannot upload my file cos its too large.
I tried sending it as a zip but still complaining its too large.
does anyone know of a way so that I can get my file checked out please?
i closed the workbook, reopened it and now that line worked fine without any issues.
This is strange.
Has anyone experienced anything of this sort?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks