ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook (https://www.excelbanter.com/excel-programming/311997-workbook.html)

Steven Chan[_2_]

Workbook
 
Writing a macro to avoid openeing the same file in excel.

Tom Ogilvy

Workbook
 
Dim wkbk as Workbook
On Error Resume Next
set wkbk = Workbooks("MyFile.xls")
On Error goto 0
if wkbk is nothing then
set wkbk = Workbooks.open Filename:= _
"C:\MyFolder\MyFile.xls"
End if
wkbk.Activate
--
Regards,
Tom Ogilvy

"Steven Chan" wrote in message
...
Writing a macro to avoid openeing the same file in excel.





All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com