Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Errors of Adding OWC10 Spreadsheet reference
I use the following code to add the owc10 reference to my project. It
always leads errors on some computers. Your help is highly appreciated Dim ref As Object, HasOWC10 As Boolean For Each ref In ThisWorkbook.VBProject.References If ref.Name = "OWC10" Then HasOWC10 = True End If Next If HasOWC10 = False Then ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\Web Components \10\OWC10.DLL") For the computers with such error, I also can not add the reference mannually IN VBA environment by clicking: Tools - References - Browse (C:\Program Files\Common Files\Microsoft Shared\Web Components\10\OWC10.DLL) - OK gzhu |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Errors of Adding OWC10 Spreadsheet reference
The general problem is that the code references a specific file in a
specific place. Different versions of Excel will have a different name for "OWC10". A somewhat more general way of doing this is to use the ".GUID' property of VBProject.References. This should always work in theory since the GUID value should be stable across various versions of Excel. There has been at least on exception to this in Microsoft's history, but it's a generally much better guess than file name. The next issue, of course, is that you're trying to assert a reference based on hard-wired file name and path. This is unlikely to work across different versions of Excel, and will fail within the same version of Excel depending on where they installed the program. One example on the Web about doing this is http://www.vbaexpress.com/kb/getarticle.php?kb_id=267 -- and there are no doubt many others. HTH / Tyla / On Apr 6, 1:54 pm, "Bula" wrote: I use the following code to add the owc10 reference to my project. It always leads errors on some computers. Your help is highly appreciated Dim ref As Object, HasOWC10 As Boolean For Each ref In ThisWorkbook.VBProject.References If ref.Name = "OWC10" Then HasOWC10 = True End If Next If HasOWC10 = False Then ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\Web Components \10\OWC10.DLL") For the computers with such error, I also can not add the reference mannually IN VBA environment by clicking: Tools - References - Browse (C:\Program Files\Common Files\Microsoft Shared\Web Components\10\OWC10.DLL) - OK gzhu |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Errors of Adding OWC10 Spreadsheet reference
That's great. Thank you alot, Tyla!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
#REF! - Invalid Cell Reference Errors | Setting up and Configuration of Excel | |||
Pivot Bar Chart - adding errors? | Charts and Charting in Excel | |||
Errors in VB Code since adding macro | Excel Discussion (Misc queries) | |||
Ignoring reference errors | Excel Programming | |||
ComboBox RowSource --- can I use a userform OWC10 spreadsheet range? | Excel Programming |