Thread: Workbook Open?
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GrantW GrantW is offline
external usenet poster
 
Posts: 17
Default Workbook Open?

Hi Jim,
You answered this ages ago, I know, but how could I adapt your code to look
for the file in our main server. Would I include the filepath as:

set wbk = workbooks("\\servername\serversubdirectory\MyBook. xlsx") ?

Oh... and thanks :)


"Jim Thomlinson" wrote:

My prefered method...This one opens the book if it is not open...

dim wbk as workbook

on error resume next
set wbk = workbooks("MyBook.xls")
on error goto 0

if wbk is nothing then
msgbox "Opening the book now"
set wbk = workbooks.Open("C:\MyBook.xls")
end if
--
HTH...

Jim Thomlinson


"ArthurJ" wrote:

How can I test to see if a particular workbook is open?

Thanks,
Art