Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default In Macros - compilation error

To check whether the file is already open or not i got a command "Res =
IsWorkbookOpen("BOOK3.xls")" when i am running this command i get a
compilation error as "sub or function not defined". Can anybody help me.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default In Macros - compilation error


sub TestMe()
Dim oWb as WorkBook
on error resume next
set owb = Workbooks("Book3.xls")
on error goto 0
if oWB is nothing then
msgbox "not opened"
else
msgbox ("opened")
endif
end sub


Cheers,
--
AP

"Vijay Kotian" a écrit dans le
message de news: ...
To check whether the file is already open or not i got a command "Res =
IsWorkbookOpen("BOOK3.xls")" when i am running this command i get a
compilation error as "sub or function not defined". Can anybody help me.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default In Macros - compilation error

As a function:

Function isOpened(sWB As String)
Dim oWb As Workbook
On Error Resume Next
Set oWb = Workbooks("Book3.xls")
On Error GoTo 0
isOpened = Not oWb Is Nothing
End Function

Cheers,
--
AP

"Ardus Petus" a écrit dans le message de news:
...

sub TestMe()
Dim oWb as WorkBook
on error resume next
set owb = Workbooks("Book3.xls")
on error goto 0
if oWB is nothing then
msgbox "not opened"
else
msgbox ("opened")
endif
end sub


Cheers,
--
AP

"Vijay Kotian" a écrit dans le
message de news:
...
To check whether the file is already open or not i got a command "Res =
IsWorkbookOpen("BOOK3.xls")" when i am running this command i get a
compilation error as "sub or function not defined". Can anybody help me.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default In Macros - compilation error

Ooops:

Function isOpened(sWB As String)
Dim oWb As Workbook
On Error Resume Next
Set oWb = Workbooks(sWB)
On Error GoTo 0
isOpened = Not oWb Is Nothing
End Function


"Ardus Petus" a écrit dans le message de news:
...
As a function:

Function isOpened(sWB As String)
Dim oWb As Workbook
On Error Resume Next
Set oWb = Workbooks("Book3.xls")
On Error GoTo 0
isOpened = Not oWb Is Nothing
End Function

Cheers,
--
AP

"Ardus Petus" a écrit dans le message de news:
...

sub TestMe()
Dim oWb as WorkBook
on error resume next
set owb = Workbooks("Book3.xls")
on error goto 0
if oWB is nothing then
msgbox "not opened"
else
msgbox ("opened")
endif
end sub


Cheers,
--
AP

"Vijay Kotian" a écrit dans le
message de news:
...
To check whether the file is already open or not i got a command "Res =
IsWorkbookOpen("BOOK3.xls")" when i am running this command i get a
compilation error as "sub or function not defined". Can anybody help
me.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: Compilation error in Module 1. How can I find it? Tom Torda Excel Discussion (Misc queries) 1 January 13th 07 11:51 PM
Compilation error when using an English VB program on a French Exc Andy Shen Excel Programming 2 May 25th 06 06:25 PM
Compilation error in Excel 97 vinayrbedre Excel Programming 2 July 7th 05 09:02 AM
VBA Excel compilation error + Z + Excel Programming 1 January 15th 05 05:54 PM
Compilation error question Nathan Gutman Excel Programming 7 December 5th 03 07:54 PM


All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"