T/F Can't set Hyperlink base from within macro

C

Chris Beall

Excel 2000.

I wanted to set the Hyperlink base from within a macro. Then I read:

"BuiltinDocumentProperties Property
Returns a DocumentProperties collection that represents all the built-in
document properties for the specified workbook. Read-only."

Among the listed built-in properties is "Hyperlink Base". Putting that
together with "read only", I deduce that although I can set the
Hyperlink Base as a user, this cannot be done via a macro.

Am I correct or is there a loophole somewhere that would allow me to do
this?

Chris Beall
 
G

Gary''s Student

Hi Chris:

Sub chris3()
ActiveWorkbook.BuiltinDocumentProperties(29) = "G:\"
End Sub
 
D

Dave Peterson

I'm not sure I'd trust that number to always be the same. (I don't know if it
changes at all, though.)

But I'd use the name

ActiveWorkbook.BuiltinDocumentProperties("Hyperlink Base") = "G:\"
 
C

Chris Beall

Gary''s Student said:
Hi Chris:

Sub chris3()
ActiveWorkbook.BuiltinDocumentProperties(29) = "G:\"
End Sub

GS,

OK, I'll bite. Where did you get the 29 from?

I'm not questioning it, just trying to learn what the documentation
sources are.

Thanks,
Chris Beall
 
G

Gary''s Student

Hi Chris:

Its in Help. You can always generate the numbers, name, and values with:

Sub chris4()
i = 1
For Each p In ActiveWorkbook.BuiltinDocumentProperties
Cells(i, 1) = i
Cells(i, 2) = p.Name
On Error Resume Next
Cells(i, 3) = p.Value
i = i + 1
Next
End Sub
 
C

Chris Beall

Gary''s Student said:
Hi Chris:

Its in Help. You can always generate the numbers, name, and values with:

Sub chris4()
i = 1
For Each p In ActiveWorkbook.BuiltinDocumentProperties
Cells(i, 1) = i
Cells(i, 2) = p.Name
On Error Resume Next
Cells(i, 3) = p.Value
i = i + 1
Next
End Sub

GS,

Well, sorta. In Excel 2000 Help, there is indeed a list of the Built-in
properties, and if you notice that they are NOT in alphabetical order
and then count down the list, starting with the first column, you'll
find that, indeed, Hyperlink Base is the 29th one.

Of course, they might have said something like, "The following list
shows the properties IN THE ORDER OF THEIR INDEX NUMBERS."

Anyway, thanks again.

Chris Beall
 
G

Gary''s Student

Chris:
You are doing just fine. We will always perservere in spite of imperfect
documentation.

If you run into a snag, just post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top