Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msgbox in this


How to check any file active or not

if window("file.abc").active = true then
do function
else
msgbox "error"
end if

what's wrong with this ?

thank you


--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=565232

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default How to popup msgbox in this

Hi vumian,

To check to see if a named workbook is currently open, you could use this
function:

Public Function gbIsWBOpen(rsName As String) As Boolean
On Error Resume Next
gbIsWBOpen = Len(Workbooks(rsName).Name)
On Error GoTo 0
End Function

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

vumian wrote:
How to check any file active or not

if window("file.abc").active = true then
do function
else
msgbox "error"
end if

what's wrong with this ?

thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msgbox in this


hi Jake Marx,

it's great man, thank you very much.
Brgds

--
vumia
-----------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...fo&userid=3649
View this thread: http://www.excelforum.com/showthread.php?threadid=56523

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msgbox in this


hi Jake Marx,

it's great man, thank you very much.
Brgds,


--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=565232

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msgbox in this


hi Jake Marx,

it's great man, thank you very much.
Brgds

--
vumia
-----------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...fo&userid=3649
View this thread: http://www.excelforum.com/showthread.php?threadid=56523



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msgbox in this


it's has a little problem

Public Function gbIsWBOpen(rsName As String) As Boolean
On Error Resume Next
gbIsWBOpen = Len(Workbooks(rsName).Name)
On Error GoTo 0
End Function


sub abc()
if gbIsWBOpen("filename.doc")=true then
do function
else
msgbox "error"
end if



What's wrong with this sub abc() ???

thanks your help.


--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=565232

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default How to popup msgbox in this

Hi vumian,

Are you looking for a file that may be open in another application (I see
you're looking for a filename with extension "doc")? If so, this won't
work. The function below only checks for Excel workbooks with the given
name that are open.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]


vumian wrote:
it's has a little problem

Public Function gbIsWBOpen(rsName As String) As Boolean
On Error Resume Next
gbIsWBOpen = Len(Workbooks(rsName).Name)
On Error GoTo 0
End Function

sub abc()
if gbIsWBOpen("filename.doc")=true then
do function
else
msgbox "error"
end if

What's wrong with this sub abc() ???

thanks your help.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msgbox in this


hi man,

no man, i wrote above, it's just a example :))
atually, i'm not looking for a filename with extension "doc", just xls
only
but it has not worked so far , hixhix :(

i wanna check if that file is not opened,
how to msgbox for this ??
help me pls.


--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=565232

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default How to popup msgbox in this

Hi vumian,

vumian wrote:
no man, i wrote above, it's just a example :))
atually, i'm not looking for a filename with extension "doc", just xls
only
but it has not worked so far , hixhix :(

i wanna check if that file is not opened,
how to msgbox for this ??
help me pls.


Your code should work - it does for me. For a workbook that has been saved
before, you should always use .xls at the end of the filename when you're
checking to see if it's part of the active Workbooks collection. So if you
have a workbook named filename.xls that you want to check for, you would use
gbIsWBOpen("filename.xls"), which will return True if the workbook is open
and False if it's not.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]


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
How to popup msg box ? vumian[_12_] Excel Programming 3 July 29th 06 02:37 PM
popup box Rob Excel Programming 0 March 2nd 06 04:21 PM
Popup MsgBox jackle Excel Discussion (Misc queries) 1 February 13th 06 03:44 AM
Making a Msgbox popup Todd Huttenstine[_2_] Excel Programming 5 December 28th 03 10:49 PM
MsgBox Popup in Excel Danny Legault Excel Programming 1 November 6th 03 02:13 PM


All times are GMT +1. The time now is 05:32 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"