Shoji,
Spookily enough, we had the same questionm earlier today. The solution is to
test the Application.Version property, and then call code appropriate to the
version. As Harald Staff pointed out to me, the trick is to place that into
an isolated sub that won't be called in 97 otherwise you get a compilation
error when running in 97.
Somthing like this, it only shows the for show, but the same principle
applies for StartupPosition.
Sub Main()
Select Case Val(Application.Version)
Case 8
UserForm1.Show
Case 9 To 99
Call Modeles
Case Else
End Select
End Sub
Private Sub Modeles()
UserForm1.Show vbModeless
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"Shoji Kaku" wrote in message
...
I've used the FormPositioner module from Chip Pearson to position the
userforms at a particular place on the spreadsheet. It works great with
Excel 2000. But, I found a problem when trying to use the same
application with Excel 97. The VBA version in Excel 97 doesn't seem to
be able to compile the vbModal argument that follows the frmXXXX.Show
statement. Secondly, the userform I had set the StartUpPosition
property to 0 - Manual in Excel 2000, somehow got reset to the default 1
- CenterOwner in Excel 97. I can get around these problems by
commenting out the vbModal and re-setting the StartUpPosition property
on the userform manually to 0 - Manual. However, this seems to mean
that I have to have two versions of this application. Is there a way
for me to handle this programmatically by using a some branch logic?
Related to that question, I have these other questions:
1. Is there a way for me to programmatically check the VBA version that
is on a version of Excel?
2. Can I programmatically set the userform StartUpPosition property to
0 - Manual?
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!