代码在另一个上运行时打开工作簿

我的问题基本上是标题…

我有一个运行里面的macros打开工作簿。 当我在这个过程中尝试打开另一个工作簿时,它会永久加载。

问题:如果我在工作簿中运行macros,是否有办法打开另一个工作簿?

关于正在运行的代码,我确保使用ThisWorkbook命名,以便它不会被打开其他工作簿。

为了您的信息我的代码是:

Option Explicit Private objIE As SHDocVw.InternetExplorer Sub MySub() 'i)Declaration of the variables Dim i As Integer Dim Path As String ' stores the path 'ii)Path to the platform Path = "https://www.mywebsite.com" '1)Navigate to the platform Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.navigate Path Do Loop While objIE.readyState <> READYSTATE_COMPLETE '3)Check Price Start: Do Loop While CLng(objIE.document.getElementsByClassName("Myclassname")(0).innerText) > 4200 And CLng(objIE.document.getElementsByClassName("Myclassname")(0).innerText) < 4500 '4) Write down the value in Excel i = i + 1 ThisWorkbook.Sheets("Tabelle1").Cells(7 + i, 4) = CLng(objIE.document.getElementsByClassName("Myclassname")(0).innerText) ' Value ThisWorkbook.Sheets("Tabelle1").Cells(7 + i, 3) = Right(Now, 8) ' Time ThisWorkbook.Sheets("Tabelle1").Cells(7 + i, 2) = Date ' Date Application.Wait Now + TimeSerial(0, 0, 10) GoTo Start End Sub