Following macro works fine when I manually export but working wrong on PostReload. Im trying to copy 5 different chart values into one excel. So First I'll export heading and copy and paste 5 chart values one by one but on PostReload "CH2030" values only coping 5 times.
This macro worked manually like expected and per reload-trigger it will be only the csv with CH2039 created?
I think before going deeper with searching on possible differences between both methods and if there are solutions or workarounds should the routine be changed. Then at first you creates a csv-file which you then within a loop each time in a new excel-instance opened and stored (you will have many open excel-instances if you looked into the taskmanager).
I suggest to create at first (after folder- and array-part) one excel-instance, create an sheet with a name * and copy then all objects one after another into this sheet and store then the excel again and add also ActiveDocument.GetApplication.WaitForIdle instead this sleep-statement to make sure that qv is finish with calculations if your routine goes to the next step.
In PostReload trigger 5th chart values are repeating 5 times. And previously I did the code which open the file before loop and paste values into file and save it after loop but that also causes some other issue like running the macro more than twice works correctly but not at first time. So changed to this routine.