ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Wait opening file (https://www.excelbanter.com/excel-programming/314926-wait-opening-file.html)

Luis

Wait opening file
 
Hello.
I have a macro that need to browse for a file. I'm using GetOpenFilename
method. What i need to do now is to wait until the file is loaded to continue
the execution of the code.
Is this possible?

Thanks.


Dale Preuss[_2_]

Wait opening file
 
Luis,

Try this...
Dim strFreshFile as String
Dim wkbFreshFile as Workbook

strFreshFile = Application.GetOpenFileName(what ever paramters you've got)
if strFreshFile < "False" Then
Set wkbFreshFile = Workbooks.Open(Filename:=strFreshFile)
end if

This should do the trick.
Dale Preuss


"Luis" wrote:

Hello.
I have a macro that need to browse for a file. I'm using GetOpenFilename
method. What i need to do now is to wait until the file is loaded to continue
the execution of the code.
Is this possible?

Thanks.



All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com