melodramatic
Board Regular
- Joined
- Apr 28, 2003
- Messages
- 187
- Office Version
- 365
- Platform
- Windows
I am having a strange problem come up that I've never seen before. Hoping someone can tell me where I've glitched my code, so I can fix it and quit feeling like an idiot.
I am running a macro that pulls a list of new projects and enters the data into the Audit Log. The problem I'm having is that the Audit Log opens, and then the macro freezes on that page. No going further, no messages, no anything.
If for some reason I already have the Audit Log open, then the macro runs full-out, without a hiccup to be had.
Is there something that I'm doing wrong on the opening of that second file that keeps it from going on from there?
While this isn't an emergency (I can simply let it stop, then go back to wb1 and hit the macro again, and since the Audit Log is open, it works then), it's frustrating as heck. Hoping someone can help me.
Thank you so much for taking the time to look at this!
I am running a macro that pulls a list of new projects and enters the data into the Audit Log. The problem I'm having is that the Audit Log opens, and then the macro freezes on that page. No going further, no messages, no anything.
If for some reason I already have the Audit Log open, then the macro runs full-out, without a hiccup to be had.
Is there something that I'm doing wrong on the opening of that second file that keeps it from going on from there?
While this isn't an emergency (I can simply let it stop, then go back to wb1 and hit the macro again, and since the Audit Log is open, it works then), it's frustrating as heck. Hoping someone can help me.
Thank you so much for taking the time to look at this!
Code:
Sub ProjectTasks()
' Run Audit Log entry & Create New MDR
' Written by Melody October May
' Created Jul 6, 2020
Application.ScreenUpdating = False
Application.AskToUpdateLinks = False
Application.DisplayAlerts = False
On Error GoTo ErrorHandler
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim pwd As String
Dim pwdX As String
pwd = Range("Z1")
ActiveWorkbook.Unprotect Password:=pwd
Set wb1 = ActiveWorkbook
Workbooks.Open Filename:="X:\QASystems\Audit Projects Status Log.xlsm"
'THIS IS WHERE MY PROBLEM OCCURS - THE MACRO HANGS UP HERE UNLESS THE LOG IS ALREADY OPEN
Sheets("All Projects").Select
Set wb2 = ActiveWorkbook
pwdX = Range("AB1")
Set wb2 = ActiveWorkbook
wb1.Activate
'Enter into Audit Projects Log