Hi All-
I have a small vba script that opens and closes a workbook behind the scenes. I need to let the workbook stay open for a few seconds at most to allow for another workbook to update, then I want the source workbook to close.
When the source workbook goes to close, it asks "This action will cancel a pending data refresh. Continue?" and then it asks if I want to save the sourve file, which I do not. How do I: 1) Allow the source workbook to stay open for a second or two?, 2) have vba script select "okay" when asked to continue?, and 3) select do not save when the source workbook closes. Below is the basic code I have started with. Thank you!!!
Application.ScreenUpdating
= False
Dim strSourceWB As String
strSourceWB = Worksheets("Project Plan Overview_Sampling").Range(
"b5").Valu
e
Workbooks.Open (strSourceWB)
ActiveWorkbook.Close
Start Free Trial