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 msg box ?


I have 2 files: file1 and file2

i wanna copy the contain of sheet21 of file2 into sheet11 of file 1
But , if file2 is not active. How to popup msg box for this case ?

thank you for help .


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to popup msg box ?

Hi vumian

Not needed that the file or sheet is active when you copy

You can test if a file is open with this function

Function bIsBookOpen(ByRef szBookName As String) As Boolean
' Rob Bovey
On Error Resume Next
bIsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function


Use like this

If bIsBookOpen("test.xls") Then

--
Regards Ron de Bruin
http://www.rondebruin.nl



"vumian" wrote in message
...

I have 2 files: file1 and file2

i wanna copy the contain of sheet21 of file2 into sheet11 of file 1
But , if file2 is not active. How to popup msg box for this case ?

thank you for help .


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msg box ?


If Workbooks("abc.xls").Activate = True Then
Call function
Else
MsgBox "Error"
End If

What's wrong with this code

thank your for help

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to popup msg box ?


Ron de Bruin Wrote:
Hi vumian

Not needed that the file or sheet is active when you copy

You can test if a file is open with this function

Function bIsBookOpen(ByRef szBookName As String) As Boolean
' Rob Bovey
On Error Resume Next
bIsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function


Use like this

If bIsBookOpen("test.xls") Then

--
Regards Ron de Bruin
http://www.rondebruin.nl


Oh, it work great . thank you very much
a good man.



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

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
Popup calendar GerryK Excel Discussion (Misc queries) 1 April 4th 07 07:14 PM
popup box Rob Excel Programming 0 March 2nd 06 04:21 PM
"Why did we get here????" popup jtwspoon Excel Discussion (Misc queries) 3 February 4th 05 04:57 AM
Conditional popup William Hamilton[_2_] Excel Programming 4 May 8th 04 11:36 PM
Are you sure popup box Todd Huttenstine[_2_] Excel Programming 2 November 9th 03 09:38 PM


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