ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trap error in: ThisWorkbook.VBProject.References.Item(i).FullPath (https://www.excelbanter.com/excel-programming/377030-trap-error-thisworkbook-vbproject-references-item-i-fullpath.html)

Dennis

Trap error in: ThisWorkbook.VBProject.References.Item(i).FullPath
 
2003

I am getting an runtime-error with
ThisWorkbook.VBProject.References.Item(i).FullPath
the error message claims not registered. That said, my routine obtains
the following fine:

..Item(i).Name (OK)
..Item(i).Description (OK)
..Item(i).FullPath (fails)

First, I am failing in my attempt to trap the error via: (Please help
on this also)

[ThisWorkbook.VBProject.References]

If IsError(.Item(i).FullPath) Then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = .Item(i).FullPath
End If

Second, using ToolsReferences, I have "Browsed" to
C:\WINDOWS\System32\scrrun.dll clicked OK to no avail.

How can I force a clean recognition in the Registry so that I do not
get the error in the first place?

TIA EagleOne


Tom Ogilvy

Trap error in: ThisWorkbook.VBProject.References.Item(i).FullPath
 
Dim s as String
s = ""
On Error Resume Next
s = .Item(i).FullPath
On Error goto 0
if s = "" then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = s
End If

--
Regards,
Tom Ogilvy

"Dennis" wrote:

2003

I am getting an runtime-error with
ThisWorkbook.VBProject.References.Item(i).FullPath
the error message claims not registered. That said, my routine obtains
the following fine:

..Item(i).Name (OK)
..Item(i).Description (OK)
..Item(i).FullPath (fails)

First, I am failing in my attempt to trap the error via: (Please help
on this also)

[ThisWorkbook.VBProject.References]

If IsError(.Item(i).FullPath) Then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = .Item(i).FullPath
End If

Second, using ToolsReferences, I have "Browsed" to
C:\WINDOWS\System32\scrrun.dll clicked OK to no avail.

How can I force a clean recognition in the Registry so that I do not
get the error in the first place?

TIA EagleOne



Dennis

Trap error in: ThisWorkbook.VBProject.References.Item(i).FullPath
 
Thanks for your time and knowledge Tom

If you have a moment, why could I not Trap the error w/o the use of the
"string"? Also, how do I get C:\WINDOWS\System32\scrrun.dll to register
properly?

EagleOne


Tom Ogilvy wrote:
Dim s as String
s = ""
On Error Resume Next
s = .Item(i).FullPath
On Error goto 0
if s = "" then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = s
End If

--
Regards,
Tom Ogilvy

"Dennis" wrote:

2003

I am getting an runtime-error with
ThisWorkbook.VBProject.References.Item(i).FullPath
the error message claims not registered. That said, my routine obtains
the following fine:

..Item(i).Name (OK)
..Item(i).Description (OK)
..Item(i).FullPath (fails)

First, I am failing in my attempt to trap the error via: (Please help
on this also)

[ThisWorkbook.VBProject.References]

If IsError(.Item(i).FullPath) Then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = .Item(i).FullPath
End If

Second, using ToolsReferences, I have "Browsed" to
C:\WINDOWS\System32\scrrun.dll clicked OK to no avail.

How can I force a clean recognition in the Registry so that I do not
get the error in the first place?

TIA EagleOne




Chip Pearson

Trap error in: ThisWorkbook.VBProject.References.Item(i).FullPath
 
It sounds like the ScrRun.dll got its registration with Windows messed up. I
would do the following.

Close all open applications.
Go to the Windows Start Menu and choose Run.
Enter the following, including the quotes, and click OK.
RegSvr32 "C:\Windows\System32\ScrRun.dll" /u
Then go back to the Run dialog and enter the following
RegSvr32 "C:\Windows\System32\ScrRun.dll"

This will un-register the component with Windows (the /u switch means
un-register) and then re-registser the componet. You should get success
dialogs for each of the calls to RegSvr32. This assumes that ScrRun.dll does
in fact reside in "C:\Windows\System32". I assume you have checked that the
file does in fact exist.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)



"Dennis" wrote in message
ups.com...
2003

I am getting an runtime-error with
ThisWorkbook.VBProject.References.Item(i).FullPath
the error message claims not registered. That said, my routine obtains
the following fine:

.Item(i).Name (OK)
.Item(i).Description (OK)
.Item(i).FullPath (fails)

First, I am failing in my attempt to trap the error via: (Please help
on this also)

[ThisWorkbook.VBProject.References]

If IsError(.Item(i).FullPath) Then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = .Item(i).FullPath
End If

Second, using ToolsReferences, I have "Browsed" to
C:\WINDOWS\System32\scrrun.dll clicked OK to no avail.

How can I force a clean recognition in the Registry so that I do not
get the error in the first place?

TIA EagleOne




Dennis

Trap error in: ThisWorkbook.VBProject.References.Item(i).FullPath
 
Of course, the "unregister" failed but
RegSvr32 "C:\Windows\System32\ScrRun.dll" did the trick

Thanks Chip


Chip Pearson wrote:
It sounds like the ScrRun.dll got its registration with Windows messed up. I
would do the following.

Close all open applications.
Go to the Windows Start Menu and choose Run.
Enter the following, including the quotes, and click OK.
RegSvr32 "C:\Windows\System32\ScrRun.dll" /u
Then go back to the Run dialog and enter the following
RegSvr32 "C:\Windows\System32\ScrRun.dll"

This will un-register the component with Windows (the /u switch means
un-register) and then re-registser the componet. You should get success
dialogs for each of the calls to RegSvr32. This assumes that ScrRun.dll does
in fact reside in "C:\Windows\System32". I assume you have checked that the
file does in fact exist.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)



"Dennis" wrote in message
ups.com...
2003

I am getting an runtime-error with
ThisWorkbook.VBProject.References.Item(i).FullPath
the error message claims not registered. That said, my routine obtains
the following fine:

.Item(i).Name (OK)
.Item(i).Description (OK)
.Item(i).FullPath (fails)

First, I am failing in my attempt to trap the error via: (Please help
on this also)

[ThisWorkbook.VBProject.References]

If IsError(.Item(i).FullPath) Then
Cells(i + 1, 3).Value = "Not in Registery Properly!!"
Else
Cells(i + 1, 3).Value = .Item(i).FullPath
End If

Second, using ToolsReferences, I have "Browsed" to
C:\WINDOWS\System32\scrrun.dll clicked OK to no avail.

How can I force a clean recognition in the Registry so that I do not
get the error in the first place?

TIA EagleOne




All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com