Excel Doesn't Complete Macro after Opening Another Workbook

前端 未结 5 1099
既然无缘
既然无缘 2021-01-17 11:02

I\'m trying to get VBA to fire the commands

sImportFilePath = Application.GetOpenFilename(FileFilter:= _
\"Excel Files (*.xls), *.xls\", Title:=\"Choose The          


        
5条回答
  •  逝去的感伤
    2021-01-17 11:35

    Just adding a single call to "DoEvents" before calling Workbooks.Open will already do the trick. So the folloiwng snippet will work:

    DoEvents
    Workbooks.Open Filename:="C:\MyPath\MyFile.xlsx"
    

提交回复
热议问题