Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's one that is shorter and doesn't use Goto.
Function IsWorkbookOpen(WBName As String) As Boolean On Error Resume Next IsWorkbookOpen = CBool(Len(Workbooks(WBName).Name)) End Function -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "WhytheQ" wrote in message oups.com... similar to Bob's : Private Function IsFileOpen(strFile As String) As Boolean Dim aName As String On Error GoTo NotOpen: aName = Workbooks(strFile).Name IsFileOpen = True GoTo FunctionEnd: NotOpen: IsFileOpen = False FunctionEnd: End Function Rgds J On Nov 14, 11:48 am, "Bob Phillips" wrote: Just try opening but handling any errors On Error Resume Next Set oWB = Workbooks.Open("C:\MyTest\myFile.xls") On Error Goto 0 If oWB Is Nothing Then MsgBox "File doen't exist here" End If -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "Vijay Kotian" wrote in ... In Excel Macros, if particiular file specified is not available in the harddisk or any other source while opening i always get a error message (debug mode). How is it possible to ignore without debugging the program every time? Pl. Help if any other alternatives are available.. Thanx- Hide quoted text -- Show quoted text - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open dbf file then close. do nothing..ignore any message. | Excel Programming | |||
Remove macros in xls file, but keep macros in xlt file | Excel Programming | |||
Can Excel ignore file links that do not yet exist? | Excel Discussion (Misc queries) | |||
Ignore file links that do not exist. | Excel Discussion (Misc queries) | |||
Code to ignore on-screen message concerning "Enable Macros." | Excel Programming |