E
emel
I'm writing macros that require a reference from Visio to Excel. Some of the
people that run the macro have Excel 2002, some have 2003. The reference
that I've assigned using Tools / References doesn't work for PCs with Excel
2002 until they manually fiddle with Tools / References on their machines.
Toward the goal of fixing this automatically, I've discovered how to track
down the references in use by a project (code sample below). I've discovered
references.addfromfile and .addfromguid. But, I prefer not to count on
knowing where other folks have installed Excel, so .addfromguid looks like
the better choice.
But, is there a way to determine a GUID programmatically on some arbitrary,
other machine? Extra points if I can specify a major and minor version to
look for. I tried .adddfromfile "Excel.exe" but had no luck.
Thanks!
Ed
This is related to the question I posted as a reply to an old thread here:
http://www.microsoft.com/office/com...ming&mid=9a00889b-d098-4bfa-9971-8c6c3927dfe9
code sample, as promised:
Sub test473()
Dim d As Visio.Document
For Each d In Documents
Debug.Print d.Name
Debug.Print d.Type
If d.Type = visTypeStencil Then
Debug.Print "Project " & d.VBProject.Name
Dim r As VBIDE.Reference
For Each r In d.VBProject.References
Debug.Print r.GUID, r.Name, r.Major, r.Minor, r.IsBroken
Next r
End If
Next d
End Sub
people that run the macro have Excel 2002, some have 2003. The reference
that I've assigned using Tools / References doesn't work for PCs with Excel
2002 until they manually fiddle with Tools / References on their machines.
Toward the goal of fixing this automatically, I've discovered how to track
down the references in use by a project (code sample below). I've discovered
references.addfromfile and .addfromguid. But, I prefer not to count on
knowing where other folks have installed Excel, so .addfromguid looks like
the better choice.
But, is there a way to determine a GUID programmatically on some arbitrary,
other machine? Extra points if I can specify a major and minor version to
look for. I tried .adddfromfile "Excel.exe" but had no luck.
Thanks!
Ed
This is related to the question I posted as a reply to an old thread here:
http://www.microsoft.com/office/com...ming&mid=9a00889b-d098-4bfa-9971-8c6c3927dfe9
code sample, as promised:
Sub test473()
Dim d As Visio.Document
For Each d In Documents
Debug.Print d.Name
Debug.Print d.Type
If d.Type = visTypeStencil Then
Debug.Print "Project " & d.VBProject.Name
Dim r As VBIDE.Reference
For Each r In d.VBProject.References
Debug.Print r.GUID, r.Name, r.Major, r.Minor, r.IsBroken
Next r
End If
Next d
End Sub