![]() |
#1
|
|||
|
|||
![]()
When the user clicks "Button1" once, the file "MyAgenda.xlsx" opens.
How do I prevent Excel from opening the file "MyAgenda.xlsx" when the user clicks "Button1" on the second click, third, and so on ? Because from the following code, the file "MyAgenda" continues to open again and again every time the user clicks on the second one and so on. Code:
Private Sub Button1_Click() Dim ObjExcel Dim ObjXls Set ObjExcel = CreateObject("Excel.Application") Set ObjXls = ObjExcel.Workbooks.Open("D:\MyAgenda.xlsx") ObjExcel.Visible = True End Sub |
Tags |
file, open, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
John Pryor | Word VBA | 4 | 07-17-2018 01:51 AM |
Prevent 'click anywhere in slide' | tradedog | PowerPoint | 2 | 06-12-2017 10:17 AM |
Any way to prevent mail appearing as read after opening from a desktop alert? | pumpkin_feet | Outlook | 0 | 10-24-2011 06:55 AM |
Prevent Appointment Item from opening? | happyaslarry | Outlook | 0 | 01-06-2011 08:46 PM |
Prevent highlighted only message from opening | Rickkimbrell | Outlook | 2 | 12-16-2009 07:42 AM |