#if..#else..#end if.

  • Thread starter Thread starter Matt Somers
  • Start date Start date
M

Matt Somers

Dear Group:

I have been thumping head, mentally speaking, over a little piece of
code
from Tom Ogilvy. From reviewing other submissions, the code and the
use of it appear to be pretty standard. Well all was working fine,
until this morning when I was staring at my computer delariously at
around 3AM.

Suddenly, the code, instead of stopping on the #else condition began
stopping on the #if vBa6 and running that code. It's pretty weird,
because I'm running Excel 97 (With VBA5, (I still don't know how
explicity check for VBA5)).

Obviously, I received an error on the "ScreenTip" part of the
Hyperlinks.Add. Yea, no kidding, thats why wrote this code. Well I
spent my time at Church this morning, thinking about this
problem..sorry God. Well before I completely turn this into a journal
entry, here's my code below. Can anyone tell me why it thinks I am
running VbA6?

Dim WKS_RNG as range

Set WKS_RNG = ActiveSheet.Range("A1")

WKS_RNG.Select

#if vba6 then

ActiveSheet.HYPERLINKS.ADD ANCHOR:=SELECTION, Address:="",
SubAddress:="", ScreenTip:="Hello World"

#else

ActiveSheet.HYPERLINKS.ADD ANCHOR:=SELECTION, ADDRESS:="",
sUBADDRESS:=""

#end if

...Please ignore any minor syntax issues, unless you feel they
contribute to
the error.

Thanks,

Matt
 
Worked fine for me in XL97.

Perhaps you need to use Rob Bovey's free code clearer utility

http://www.appspro.com

look in free downloads.

When strange things start happening, it can mean you need to "clean" your
project.
 
Back
Top