Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I have a proceedure that opens a certain file the problem is that when the proceedure is run again it reopens the file where it loses some information, is there a way to check to see if that file is already open? Thanks in Advance Jason |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jason
This will check every open workbook by it's name. If your workbook is already open it will return True in the variable fileopen. Dim FileOpen As Boolean Dim wb As Workbook FileOpen = False For Each wb In Application.Workbooks If wb.Name = "NameOfYourWorkbook.xls" Then FileOpen = True Exit For End If Next 'wb Regards Ingolf |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Error Resume Next
Set owb = Workbooks("myFile.xls") On Error GoTo 0 If Not owb Is Nothing Then MsgBox "Workbook is alraedy open" Else Set owb = Workbooks.Open("myFile.xls") End If -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Jason Zischke" wrote in message ... Hi all I have a proceedure that opens a certain file the problem is that when the proceedure is run again it reopens the file where it loses some information, is there a way to check to see if that file is already open? Thanks in Advance Jason |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to check for Open File! | Excel Discussion (Misc queries) | |||
check if file is already open | Excel Discussion (Misc queries) | |||
check if a file is open | Excel Programming | |||
File Open Check | Excel Programming | |||
check if file already is open | Excel Programming |