I have a report that I'm trying to automate. All I need for it to do before saving is to refresh the data before saving to a specific path.I used a macro and pasted this in the vba before the save code:
ActiveWorkbook.RefreshAll
And then there's also an application wait timer after that to make sure it loads in.
The strange thing is when I utilize F8 to manual go through each step of the code, the data refreshes just fine. It's just when I actually fully run it that it just skips that refresh and saves the empty report to the folder.
Some other notes:
I've got a Dim sh1 As Worksheet so I would've thought that I could do sh1.RefreshAll but I get a method error for that.
I also have a Set sh1 = ThisWorkbook.Worksheets("report")
being that the name of the one tab is report. I don't know if including these couple of things helps in finding a solution.
Any suggestions would be much appreciated. I'm pretty new to vba so I was limited to just using the macro to record the refresh all and then going from there.