Hello,
I am using VBA in my workbook to automatically open another workbook, then it will pause, so that the user has time to run a macro in the open workbook that has another macro attached to it. However, when it pauses, the user has no interaction with the open workbook. Can someone help?
Here is the code:
'//Open File to create LT file
Workbooks.Open Filename:="\\chester2\public$\Shared Folders\Wagner\" & "LTImportFileBuilder_ddc.xls"
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A2:A201").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
'//User to run the macro to create the import file
MsgBox "Press the CREATE IMPORT FILE button, press OK to close this box."
'//Pause for 15 seconds for user to run macro
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 15
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
If Application.Wait(Now + TimeValue("0:00:15")) Then
MsgBox "Press OK to continue..."
End If
Any help is appreciated.
Thank you,
Liz
I am using VBA in my workbook to automatically open another workbook, then it will pause, so that the user has time to run a macro in the open workbook that has another macro attached to it. However, when it pauses, the user has no interaction with the open workbook. Can someone help?
Here is the code:
'//Open File to create LT file
Workbooks.Open Filename:="\\chester2\public$\Shared Folders\Wagner\" & "LTImportFileBuilder_ddc.xls"
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A2:A201").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
'//User to run the macro to create the import file
MsgBox "Press the CREATE IMPORT FILE button, press OK to close this box."
'//Pause for 15 seconds for user to run macro
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 15
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
If Application.Wait(Now + TimeValue("0:00:15")) Then
MsgBox "Press OK to continue..."
End If
Any help is appreciated.
Thank you,
Liz