Thread
:
#If #else #endif
View Single Post
#
4
Posted to microsoft.public.excel.programming
Carl-Rainer Zeiss
external usenet poster
Posts: 2
#If #else #endif
Hello,
I am using O 2003
Ver gets 110 (from "1.10")
Problem is: the Code jumps directly to the #else-condition
________________________________________
Carl-Rainer Zeiss
EDV System-Beratungen
Lohrgasse 11, D-60389 Frankfurt
Tel: +49 69 90478774
Fax: +49 1212 66666111222
Mail:
"Norman Jones" schrieb im Newsbeitrag
...
Hi Carl-Rainer,
Your conditional compilation code works without problem for me.
What error do you encounter?
---
Regards,
Norman
"Carl-Rainer Zeiss" wrote in message
...
Hello,
I have to protect a worksheet. The kind of protection must depend on the
excel-version, because I have several customers with different versions
of Office.
First I tried with if-else-endif, but got a runtime error with O 2000,
because the "AllowFormatting" is not available in O 2000.
Then I tried with the #if-#else-#endif condition, but this doesn't work.
I tried:
Ver = CCur(Application.Version)
#If Ver = 10 Then
pwTab.Protect UserInterfaceOnly:=True, _
Password:=Pw, _
AllowFormattingColumns:=True, _
AllowFormattingCells:=True
#Else
pwTab.Protect UserInterfaceOnly:=True, _
Password:=Pw
#End If
Then I read the help and it says I have to use a special constant #const,
but how should I get the "Application.Version" into a constant?
________________________________________
Carl-Rainer Zeiss
EDV System-Beratungen
Lohrgasse 11, D-60389 Frankfurt
Tel: +49 69 90478774
Fax: +49 1212 66666111222
Mail:
Reply With Quote
Carl-Rainer Zeiss
View Public Profile
Find all posts by Carl-Rainer Zeiss