Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I want a macro to check is a file, which is called upon, is already open and if so skips the opening line of the code and proceeds with the rest, otherwise proceed with opening the file. Currently Excel asks me if I want to reopen the file and unsaved data will be lost. Cheers, Harold |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dim Wkbk as workbook
.... set wkbk = nothing on error resume next 'don't use the drive/path here set wkbk = workbooks("somename.xls") on error goto 0 if wkbk is nothing then 'not open, so open it. 'you need the drive/path here set wkbk = workbooks.open(filename:="C:\my documents\excel\somename.xls") end if mohavv wrote: Hi, I want a macro to check is a file, which is called upon, is already open and if so skips the opening line of the code and proceeds with the rest, otherwise proceed with opening the file. Currently Excel asks me if I want to reopen the file and unsaved data will be lost. Cheers, Harold -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If Then to check if a workbook is open | Excel Discussion (Misc queries) | |||
excel 2003 saved file will not open without a blank workbook open | Excel Discussion (Misc queries) | |||
how do i check an open files size? | Excel Discussion (Misc queries) | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) | |||
Check if workbook open | Excel Discussion (Misc queries) |