Anyone know of a way to do this is a generic way that will
pass older version's compiler edits? If I could somehow
address that property with a subscript, or find it in a
collection ...
Sub a()
If Application.Version = 10 Then
Application.CommandBars.DisableAskAQuestionDropdown = True
End If
End Sub
--
Regards Ron
www.rondebruin.nl
"Ron de Bruin" <ronde...@kabelfoon.nl> schreef in bericht
news:uft7sjVqCHA.2256@TK2MSFTNGP12...
> Try this
>
> If Application.Version = 10 Then
> Application.DisableAskAQuestionDropdown = True
> end if
>
> this will check the version
>
> --
> Regards Ron
> www.rondebruin.nl
>
>
> "Will Handley" <willh...@comcast.net> schreef in bericht
> news:04aa01c2a94a$b44cc7c0$89f82ecf@TK2MSFTNGXA01...
If Application.Version = 10 Then
Application.DisableAskAQuestionDropdown = True
end if
this will check the version
--
Regards Ron
www.rondebruin.nl
"Will Handley" <willh...@comcast.net> schreef in bericht
news:04aa01c2a94a$b44cc7c0$89f82ecf@TK2MSFTNGXA01...
Thanks, Ron, but the problem is that my program must run
in Exel 2K and 97 as well, and I get a compiler error
with "DisableAskAQuestion" because this property did not
exist before 2000. I was really looking for a way to refer
to that property generically. You can refer to an object,
for example, using a subscript (CommandBars("file") or
CommandBars(1), etc.
>.
>
I don't see what the problem is with my example
It will only run the line when you run it in 2002
This example from Chip you can use also
Sub test()
#If VBA6 Then
On Error Resume Next
Application.CommandBars.DisableAskAQuestionDropdown = True
If Err.Number = 0 Then
MsgBox "2002"
Else
MsgBox "2000"
End If
#Else
MsgBox "XL97"
#End If
End Sub
--
Regards Ron
www.rondebruin.nl
"Will Handley" <willh...@comcast.net> schreef in bericht
news:03d901c2a9a4$45250560$d2f82ecf@TK2MSFTNGXA09...
"Compile error: Method or data member not found" and the
property "DisableAskAQuestionDropdown" is highlighted.
If I just save as an add-in without compiling, when I try
to load the addin, I get a message "Compile error in
hidden module," so apparently it is necessary for the code
to compile.
You can see perhaps now why I am seeking a way to refer to
that property generically, without naming it, perhaps with
an index, so that the 2000 (and presumably 97 as well)
compilers will let it by.
>.
>
Thanks for your help.
>.
>
--
Regards Ron
www.rondebruin.nl
"Will Handley" <willh...@comcast.net> schreef in bericht
news:03c101c2aa00$cc998410$89f82ecf@TK2MSFTNGXA01...
Regards,
Tom Ogilvy
Ron de Bruin <ronde...@kabelfoon.nl> wrote in message
news:OF7kCUgqCHA.2472@TK2MSFTNGP10...
Sub test()
#If VBA6 Then
On Error Resume Next
Application.CommandBars.DisableAskAQuestionDropdown = True
If Err.Number = 0 Then
MsgBox "2002"
Else
MsgBox "2000"
End If
#Else
MsgBox "XL97"
#End If
End Sub
I just try it in Excel97 without any error??
I use somthing like this myself
And I never hear that anyone have a problem with it
Did you get a error on this also Tom
Sub userform_Open()
#If VBA6 Then
userform1.Show vbModeless
#Else
userform1.Show
#End If
End Sub
--
Regards Ron
www.rondebruin.nl
"Tom Ogilvy" <twog...@msn.com> schreef in bericht
news:OpWYrZgqCHA.1624@TK2MSFTNGP10...
In Excel 2000
Sub Tester3()
Dim lngVal as Long
#if VBA6 then
lngVal = 100
#Else
lngVal = 3
#end if
msgbox lngVal
End Sub
produced 100, in xl97, it produced 3.
I couldn't find the
DisableAskAQuestionDropdown
Property in xl2000.
So I think you still have a problem. Let us know if not.
Regards,
Tom Ogilvy
Will Handley <willh...@comcast.net> wrote in message
news:03c101c2aa00$cc998410$89f82ecf@TK2MSFTNGXA01...
By the way the code was from
Orlando Magalhães Filho
--
Regards Ron
www.rondebruin.nl
"Ron de Bruin" <ronde...@kabelfoon.nl> schreef in bericht
news:#mOFclgqCHA.1080@TK2MSFTNGP10...
Regards,
Tom Ogilvy
Ron de Bruin <ronde...@kabelfoon.nl> wrote in message
news:#mOFclgqCHA.1080@TK2MSFTNGP10...
How about late binding?
The following works in XL 2000 (haven't loaded XL XP so can't test it there,
but it reports "not 2002" correctly in my test):
Sub a()
Dim o As Object
Set o = Application
On Error Resume Next
o.CommandBars.DisableAskAQuestionDropdown = True
If Err.Number = 0 Then
MsgBox "2002"
Else
MsgBox "not 2002"
End If
End Sub
Regards,
Peter Beach
"Tom Ogilvy" <twog...@msn.com> wrote in message
news:uKxVGChqCHA.432@TK2MSFTNGP10...
Regards,
Tom Ogilvy
Peter Beach <pbe...@globe.net.nz> wrote in message
news:#zeczIyqCHA.2488@TK2MSFTNGP12...
Looking good
Thanks
--
Regards Ron
www.rondebruin.nl
"Peter Beach" <pbe...@globe.net.nz> schreef in bericht
news:#zeczIyqCHA.2488@TK2MSFTNGP12...