Hello guys,
I have this piece of code that is used to access a Link. Once this link is open, an excel file is automatically downloaded. This file is big and takes about 2 mins to open. The problem is that vba does not wait for the file and continues to the next line of code, which creates a problem since it is supposed to use the "already" open file. How can i make vba wait for the file to be full downloaded? I tried using:
but this doesn't works since it halts everything on excel (including download).
Another problem is that everytime i open this link, excel adds automatically _(number) at the end of the file name (if i open this file for the 10th time, its called ABC_10). How can i call this file in the next line?
here is my code :
Thanks for the help
I have this piece of code that is used to access a Link. Once this link is open, an excel file is automatically downloaded. This file is big and takes about 2 mins to open. The problem is that vba does not wait for the file and continues to the next line of code, which creates a problem since it is supposed to use the "already" open file. How can i make vba wait for the file to be full downloaded? I tried using:
Code:
application.wait
Another problem is that everytime i open this link, excel adds automatically _(number) at the end of the file name (if i open this file for the 10th time, its called ABC_10). How can i call this file in the next line?
here is my code :
Code:
Const Hyper As String = "[URL]http://can't_mention_file_name.com[/URL]"
ThisWorkbook.FollowHyperlink Address:=Hyper ', NewWindow:=True
Workbooks(Workbooks.Count).Activate ' I tried this code to avoid the change in file name
Sheets("PDF Report ").Select ' Code breaking here since it didn't find the sheet which is supposed to be in the file that is currently downloading
Thanks for the help