400 error excel vba!

ae211830

New Member
Joined
Oct 1, 2014
Messages
1
I keep getting a 400 error when running the code below. This only happens if the code goes to error handler and is then repeated immediately after. Any ideas why?



Public Sub OpenDrawing()


StopVLookup = True


Dim partno As String
On Error GoTo errorhandler


partno = Cells(ActiveCell.row, 1)
ActiveWorkbook.FollowHyperlink "\\192.168.1.202\MechDesign\All RoBAT Drawings\" & partno & ".pdf"
StopVLookup = False


Exit Sub


errorhandler:
MsgBox "Can't Find Drawing"
StopVLookup = False




End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
It means the object is not set. (not value variables)
right before the last line END SUB
put
EXIT SUB
RESUME

When the error happens, hit CTL-BREAK
debug
right click on the RESUME
SET NEXT STATEMENT
press F8 (to move 1 step ) and it will show you the bad line.
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top