![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 83
|
I have a workbook that loads a form and from this formn there are optionbuttons set thaif you click them they will open a specific file.
The problem is when you re-click on these optionbuttons the message 'Do you want to re-open file. Re-opening file will.......'. It used to end the code but I have managed to put an 'onerror' command in VBA stopping the breaking of code but it still comes up with this message. Could you please tell me how to stop this message coming up or if there is another way of detecting if the file is already open and therefore only activating the workbook. Many thanks Steve |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Application.displayalerts=false
...will make sure no pop-up messages are shown.
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Or to answer your second question, you can try the following:
Code:
On Error GoTo errorhandler
Windows("Book2.xls").Activate
Exit Sub
errorhandler:
Workbooks.Open "Book2.xls"
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|