Z
Zakynthos
Hi,
When I run the following program alone from Excel, it works fine:
Sheets("NEWTSform").Select
Select Case Range("H19").Value
Case 4
Call inputSMIDtonewtsorder
End Select
Select Case Range("H19").Value
Case 3
Call inputSMIEtonewtsorder
End Select
However, when I add this to another program which, again works fine as it
is, the program listed above doesn’t run properly – it will activate the
Window named in AppActivate, 'Staff Management' , but the ‘Call’ subroutines
don’t run - it just 'freezes'
I add in the following to the end of the previous routine (which works fine
alone) to get the ‘focus’ back to Excel before running it with:
Appactivate “Vantage Interactive Advanced.xlsâ€
With ThisWorkbook.Sheets (“NEWTSformâ€)
Appactivate “Staff Managementâ€
Sheets("NEWTSform").Select
Select Case Range("H19").Value
Case 4
Call inputSMIDtonewtsorder
End Select
Select Case Range("H19").Value
Case 3
Call inputSMIEtonewtsorder
End Select
End with
End Sub
It errors here, usually with End sub highlighted with an “Expected ‘End with
without with’ or ‘End Select’ without ‘Select’ or something similar!.
Where am I going run – it must be possible to do, if they run alone
independently, they should run end-on-end.
I’ve tried various combinations of code to reclaim the ‘focus’ back to
Excel - but it still errors!
Many thanks!
When I run the following program alone from Excel, it works fine:
Sheets("NEWTSform").Select
Select Case Range("H19").Value
Case 4
Call inputSMIDtonewtsorder
End Select
Select Case Range("H19").Value
Case 3
Call inputSMIEtonewtsorder
End Select
However, when I add this to another program which, again works fine as it
is, the program listed above doesn’t run properly – it will activate the
Window named in AppActivate, 'Staff Management' , but the ‘Call’ subroutines
don’t run - it just 'freezes'
I add in the following to the end of the previous routine (which works fine
alone) to get the ‘focus’ back to Excel before running it with:
Appactivate “Vantage Interactive Advanced.xlsâ€
With ThisWorkbook.Sheets (“NEWTSformâ€)
Appactivate “Staff Managementâ€
Sheets("NEWTSform").Select
Select Case Range("H19").Value
Case 4
Call inputSMIDtonewtsorder
End Select
Select Case Range("H19").Value
Case 3
Call inputSMIEtonewtsorder
End Select
End with
End Sub
It errors here, usually with End sub highlighted with an “Expected ‘End with
without with’ or ‘End Select’ without ‘Select’ or something similar!.
Where am I going run – it must be possible to do, if they run alone
independently, they should run end-on-end.
I’ve tried various combinations of code to reclaim the ‘focus’ back to
Excel - but it still errors!
Many thanks!