Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default MODAL vs. NonMODAL

To ALl,

I have a USER FORM that works fine as a MODAL form ... Since it was
developed on an Excel 97 platform. I understand and accept the
limitation ... IF the Workbook is opened on Excel 2000 platform,
however, I'd like to be able to Display the same form as Non-Modal ...

Question: Can it be determined in VBA code, prior to the USER Form
being loaded, that the current version of excel is capable of
displaying a Non-Modal form?

Thanks ....

Jim P
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default MODAL vs. NonMODAL

Jim,

You could test the application version

Sub show()
If Val(Application.Version) = 9 Then
ShowNonModal
Else
ShowModal
End If
End Sub

Sub ShowNonModal()
UserForm1.show 0
End Sub

Sub ShowModal()
UserForm1.show
End Sub

You have to be careful of compilation errors in XL97, so you might need to
put the ShowNonModal proc in a separate module. I can't test as I don't have
97 handy.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JimP" wrote in message
om...
To ALl,

I have a USER FORM that works fine as a MODAL form ... Since it was
developed on an Excel 97 platform. I understand and accept the
limitation ... IF the Workbook is opened on Excel 2000 platform,
however, I'd like to be able to Display the same form as Non-Modal ...

Question: Can it be determined in VBA code, prior to the USER Form
being loaded, that the current version of excel is capable of
displaying a Non-Modal form?

Thanks ....

Jim P



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default MODAL vs. NonMODAL

Bob,

Thanks for the PROMPT response ...

I coded as you specified ...
''''''''''''''''''''''
Private Sub NAVIGATIONButton_Click()
Application.ScreenUpdating = True
Load frmNAVIGATION
If Val(Application.Version) = 9 Then
ShowNonModal
Else
ShowModal
End If
End Sub

Sub ShowModal()
frmNAVIGATION.show 'Excel 97
End Sub

Sub ShowNonModal()
frmNAVIGATION.show 0 'Excel 2000 +
End Sub
''''''''''''''''''''''''''''''''''

WORKS PERFECT IN BOTH VERSIONS OF EXCEL ...
THANKS a MILLION ...

J.Pellechi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default MODAL vs. NonMODAL

Bob is absolutely right and using the 0 rather than vbModeless statement
makes this work, but for safety's sake on this technique where you are
differentiating between 97 and later versions you might want to add a
conditional compilation clause around the non-modal statement.

ie.
Sub ShowNonModal()
#If VBA6 Then
frmNAVIGATION..Show vbModeless
#End If
End Sub

Robin Hammond
www.enhanceddatasystems.com

"microsoft.public.excel.programming" wrote in message
...
Bob,

Thanks for the PROMPT response ...

I coded as you specified ...
''''''''''''''''''''''
Private Sub NAVIGATIONButton_Click()
Application.ScreenUpdating = True
Load frmNAVIGATION
If Val(Application.Version) = 9 Then
ShowNonModal
Else
ShowModal
End If
End Sub

Sub ShowModal()
frmNAVIGATION.show 'Excel 97
End Sub

Sub ShowNonModal()
frmNAVIGATION.show 0 'Excel 2000 +
End Sub
''''''''''''''''''''''''''''''''''

WORKS PERFECT IN BOTH VERSIONS OF EXCEL ...
THANKS a MILLION ...

J.Pellechi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default MODAL vs. NonMODAL

Not correct. vbModeless works just as well. It would only be a problem as a
run time error as in XL97 the show would have too many arguments, but as the
version test stops it taking this path there is no problem.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Robin Hammond" wrote in message
...
Bob is absolutely right and using the 0 rather than vbModeless statement
makes this work, but for safety's sake on this technique where you are
differentiating between 97 and later versions you might want to add a
conditional compilation clause around the non-modal statement.

ie.
Sub ShowNonModal()
#If VBA6 Then
frmNAVIGATION..Show vbModeless
#End If
End Sub

Robin Hammond
www.enhanceddatasystems.com

"microsoft.public.excel.programming" wrote in message
...
Bob,

Thanks for the PROMPT response ...

I coded as you specified ...
''''''''''''''''''''''
Private Sub NAVIGATIONButton_Click()
Application.ScreenUpdating = True
Load frmNAVIGATION
If Val(Application.Version) = 9 Then
ShowNonModal
Else
ShowModal
End If
End Sub

Sub ShowModal()
frmNAVIGATION.show 'Excel 97
End Sub

Sub ShowNonModal()
frmNAVIGATION.show 0 'Excel 2000 +
End Sub
''''''''''''''''''''''''''''''''''

WORKS PERFECT IN BOTH VERSIONS OF EXCEL ...
THANKS a MILLION ...

J.Pellechi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default MODAL vs. NonMODAL

In development, if regularly compiling the project in XL97, I find it's more
"convenient" to use the conditional construct with VBA6. Avoids the compile
error and the necessity to add the Modeless routine only after compiling.
Apart from this, both methods work fine.

Regards,
Peter

"Bob Phillips" wrote in message
...
Not correct. vbModeless works just as well. It would only be a problem as

a
run time error as in XL97 the show would have too many arguments, but as

the
version test stops it taking this path there is no problem.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Robin Hammond" wrote in message
...
Bob is absolutely right and using the 0 rather than vbModeless statement
makes this work, but for safety's sake on this technique where you are
differentiating between 97 and later versions you might want to add a
conditional compilation clause around the non-modal statement.

ie.
Sub ShowNonModal()
#If VBA6 Then
frmNAVIGATION..Show vbModeless
#End If
End Sub

Robin Hammond
www.enhanceddatasystems.com

"microsoft.public.excel.programming" wrote in

message
...
Bob,

Thanks for the PROMPT response ...

I coded as you specified ...
''''''''''''''''''''''
Private Sub NAVIGATIONButton_Click()
Application.ScreenUpdating = True
Load frmNAVIGATION
If Val(Application.Version) = 9 Then
ShowNonModal
Else
ShowModal
End If
End Sub

Sub ShowModal()
frmNAVIGATION.show 'Excel 97
End Sub

Sub ShowNonModal()
frmNAVIGATION.show 0 'Excel 2000 +
End Sub
''''''''''''''''''''''''''''''''''

WORKS PERFECT IN BOTH VERSIONS OF EXCEL ...
THANKS a MILLION ...

J.Pellechi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!







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
Userform modal Dave K[_3_] Excel Discussion (Misc queries) 1 April 9th 10 07:41 AM
Forms that are modal in 97 are not modal in 2003 Old Car Excel Discussion (Misc queries) 1 April 27th 05 08:25 AM
Non-Modal InputBox? NooK[_38_] Excel Programming 3 July 9th 04 04:58 PM
Modal oddity Ken McLennan[_3_] Excel Programming 2 May 27th 04 06:49 AM
Modal User Form Jim M[_3_] Excel Programming 1 November 4th 03 10:38 PM


All times are GMT +1. The time now is 08:50 AM.

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"