Hi,
Is there any way to capture the event of when a new workbook is opened in the excel application ? I am running some code that requests data from another application. The way that application returns the data is by opening a new workbook (with a random name) with the data in it, about 30 seconds after I run my code. I am trying to get the code to automatically recognize when a new workbook is opened, and then copy/paste a range into my active workbook.
I cannot find a way to do this. I tried using Application.Wait to pause the code for 30 seconds, but since this hangs the application, the new workbook is only opened after the 30 seconds and after the copy/paste module is run . I guess I would have to use some sort of event handler procedure to capture the new workbook being opened but can't figure out how.
Might anyone have any tips on how this can be done ? Would be a huge help. Thanks a lot in advance!
Is there any way to capture the event of when a new workbook is opened in the excel application ? I am running some code that requests data from another application. The way that application returns the data is by opening a new workbook (with a random name) with the data in it, about 30 seconds after I run my code. I am trying to get the code to automatically recognize when a new workbook is opened, and then copy/paste a range into my active workbook.
I cannot find a way to do this. I tried using Application.Wait to pause the code for 30 seconds, but since this hangs the application, the new workbook is only opened after the 30 seconds and after the copy/paste module is run . I guess I would have to use some sort of event handler procedure to capture the new workbook being opened but can't figure out how.
Might anyone have any tips on how this can be done ? Would be a huge help. Thanks a lot in advance!