View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Check if workbook open

Here is one I use from a printed name in a cell. Modify to suit

Sub GetWorkbook()
If ActiveCell.Value = "" Then Exit Sub
workbookname = ActiveCell.Value
On Error GoTo OpenWorkbook
Windows(workbookname & ".xls").Activate
Exit Sub
OpenWorkbook:
Workbooks.Open(workbookname & ".xls").RunAutoMacros xlAutoOpen
End Sub

--
Don Guillett
SalesAid Software

"dkipping" wrote in
message ...

Some macros I use require another workbook to open so I include a line
like Workbooks.Open Filename:= C:\My\ Documents\Orders\POTemp.xls
The problem occurs when that workbook is already open – the macro
stalls. Is there a way to bypass that instruction if the other
workbook is already open?


--
dkipping
------------------------------------------------------------------------
dkipping's Profile:
http://www.excelforum.com/member.php...o&userid=34683
View this thread: http://www.excelforum.com/showthread...hreadid=544484