Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
http://www.exceltip.com/st/%20Determine_if_a_workbook_is_already_open_using_V BA_<br%20/in_Microsoft_Excel/472.html The function below can be used to determine if a workbook is open o not: Function WorkbookOpen(WorkBookName As String) As Boolean ' returns TRUE if the workbook is open WorkbookOpen = False On Error GoTo WorkBookNotOpen If Len(Application.WorkBooks(WorkBookName).Name) 0 Then WorkbookOpen = True Exit Function End If WorkBookNotOpen: End Function Example: If Not WorkbookOpen("MyWorkbookName.xls") Then Workbooks.Open "MyWorkbookName.xls" End If i am using the above function in an excel file to check if anothe excel file is open. both the files are in the same folder. now i hav to write the complete path since not in My Documents. can i set it u so it will open the file from the same folder (as the file which ha this function) without writing the complete path. thanks -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Resolve Error in opening Excel File zip file from a CD? | Excel Discussion (Misc queries) | |||
opening a file in Excel starts application but dose not open file | Excel Discussion (Misc queries) | |||
Opening file in Excel 2003 opens multipule instances of same file | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) | |||
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. | Charts and Charting in Excel |