VBA Help

ai1094

Board Regular
Joined
Aug 23, 2018
Messages
81
Hi,

I have a macro that selects a different excel workbook and copies all the data from the opened workbook into the existing. See below:

Set Wbk1 = ActiveWorkbook
Fname = "L:\GCRE\Financial Modeling.xlsm"
Set Wbk2 = Workbooks.Open(Fname)
Wbk2.Sheets(1).Copy , Wbk1.Sheets(Wbk1.Sheets.Count)
Wbk2.Close False


Now, the code works. However, the workbook I am opening is also a macro-enabled workbook, which refreshes 3 different workbooks using Power Query in Excel. All 3 workbooks are refreshed and appended into the Financial Modeling.xlsm. The problem is, the workbooks aren't getting refreshed. Was wondering if anyone had an idea why?
 

MPaul100

New Member
Joined
Aug 21, 2019
Messages
16
You could create a macro to refresh them and call that one from your existing macro posted here. If it supposed to run on workbook open event automatically, then you need to add a wait for calculations event in the macro posted to wait for them to be refreshed before copying the data over.
 

Forum statistics

Threads
1,077,828
Messages
5,336,622
Members
399,093
Latest member
chado4250

Some videos you may like

This Week's Hot Topics

Top