Using Retry/Cancel MsgBox

Yeoman.jeremy

Board Regular
Joined
Apr 4, 2011
Messages
90
hi there.
I've written a macro, which requires opening a certain workbook then closing it again. I want this macro to only work if the file is closed to start with.

I know how to make an 'ok only' messagebox, but how do i use the retry/cancel, so that if there is an error with opening the file (i.e if it is already open) it runs the retry/cancel?
I want the retry to check if it can open the file again, and the cancel to stop the macro without showing the "debug, end" msgbox etc


help would be much appreciated :biggrin:
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Can you not simply use the workbook if it's already open? Why the need to close and reopen?
 
Upvote 0
The intention is that this other separate workbook shouldn't be constantly open anyway. It needs to be able to be opened and edited from other computers on the network at the same time, and if it's currently open it can only be used by other computers in read only mode.

Basically the messagebox just needs to be there to try remind staff that they shouldn't be leaving it open anyway
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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