Hello,
I try to use following error-routine to make a macro check if a file on (peer-to-peer) network is available. If the file on the network is not available, an inputbox should appear with options retry, use local copy, quit program.
sub startprogr()
Start:
On Error GoTo NoNetwork
Workbooks.Open Filename:="\\ComputerB\FileToUse.xls"
On Error GoTo 0
'no error encountered
'file on network is available
Exit sub
NoNetwork:
On Error GoTo 0
title ="Network not available"
s = "1. Retry" & vbcrlf & _
"2. Use local files" & vbcrlf & _
"3. Quit"
choice = Inputbox(s, title, 1)
If choice = 1 then goto Start
If choice = 2 then goto LocalSolution
If choice = 3 then application.quit
'....
My problem: when network is not available and using the option Retry the inputbox doesn't appear again. (VB message error 1004 appears instead.)
Does anyone know the correct error instructions?
Thank in advance for your kind help.
Rudo
I try to use following error-routine to make a macro check if a file on (peer-to-peer) network is available. If the file on the network is not available, an inputbox should appear with options retry, use local copy, quit program.
sub startprogr()
Start:
On Error GoTo NoNetwork
Workbooks.Open Filename:="\\ComputerB\FileToUse.xls"
On Error GoTo 0
'no error encountered
'file on network is available
Exit sub
NoNetwork:
On Error GoTo 0
title ="Network not available"
s = "1. Retry" & vbcrlf & _
"2. Use local files" & vbcrlf & _
"3. Quit"
choice = Inputbox(s, title, 1)
If choice = 1 then goto Start
If choice = 2 then goto LocalSolution
If choice = 3 then application.quit
'....
My problem: when network is not available and using the option Retry the inputbox doesn't appear again. (VB message error 1004 appears instead.)
Does anyone know the correct error instructions?
Thank in advance for your kind help.
Rudo