Forum Discussion
Michael_2025
May 13, 2022Copper Contributor
Method ‘Range’ of object ‘_Global’ failed
Excel Macro Error Run-time error ‘1004’ Method ‘Range’ of object ‘_Global’ failed I have written a series of macros to import and analyze csv files to track the amount of time it takes for customer...
- May 16, 2022
Thank you. The problem is that the query in Step 1 hasn't completely been refreshed yet when Step 2 is run. To avoid this, change the line
.Refresh BackgroundQuery:=Truenear the end of ImportRsStaffTechActivityRev2 to
.Refresh BackgroundQuery:=False
Michael_2025
May 16, 2022Copper Contributor
HansVogelaar I appreciate you taking a look. I have attached a csv with randomized data and macro enabled workbook. Each macro runs fine, but when combine into the 'RunReport' macro I keep getting that Range error.
HansVogelaar
May 16, 2022MVP
Thank you. The problem is that the query in Step 1 hasn't completely been refreshed yet when Step 2 is run. To avoid this, change the line
.Refresh BackgroundQuery:=True
near the end of ImportRsStaffTechActivityRev2 to
.Refresh BackgroundQuery:=False
- Michael_2025May 16, 2022Copper ContributorThat did it! I figured it was something simple like that I was missing.
Thank you so much for your help!