jdjehanneman
New Member
- Joined
- Mar 23, 2021
- Messages
- 16
- Office Version
- 365
- Platform
- Windows
Hello,
Using the code below, I want to open an xlsm file aside of the workbook from which I am executing the code.
The problem is that after opening the xlsm, the code keeps running and the macros in the xlsm cannot be executed. I have to exit manually the sub in the visual basic editor in order to be able to execute the macro's.
Private Sub bt_OpenManager_Click()
Dim strTemplateFilePath As String
Dim wkb As Excel.Workbook
If listbox_Paths_Managers.ListIndex <> -1 Then
strTemplateFilePath = PATH_CICTOOLS_ADMIN & listbox_Paths_Managers.List(listbox_Paths_Managers.ListIndex)
Set wkb = Workbooks.Open(strTemplateFilePath)
Exit Sub
End If
Exit Sub
End Sub
Can someone help me, I would really appreciate it.
Johan
Using the code below, I want to open an xlsm file aside of the workbook from which I am executing the code.
The problem is that after opening the xlsm, the code keeps running and the macros in the xlsm cannot be executed. I have to exit manually the sub in the visual basic editor in order to be able to execute the macro's.
Private Sub bt_OpenManager_Click()
Dim strTemplateFilePath As String
Dim wkb As Excel.Workbook
If listbox_Paths_Managers.ListIndex <> -1 Then
strTemplateFilePath = PATH_CICTOOLS_ADMIN & listbox_Paths_Managers.List(listbox_Paths_Managers.ListIndex)
Set wkb = Workbooks.Open(strTemplateFilePath)
Exit Sub
End If
Exit Sub
End Sub
Can someone help me, I would really appreciate it.
Johan