Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to check for project references in VBA
Hi everyone,
Can someone please help me out here. I'm trying to check is all the project references are valid for a VBA piece of code i have written and need to distribute. Currently, if there is a broken reference, the vba just ends up spiting out a runtime error. Is there an elegant way to check for this through the code. I did see examples using VBPRoject, but i am not using this object. im using pure vba. Thanks in advance :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to check for project references in VBA
Qasim,
Sub testit() Dim ref As Object For Each ref In ThisWorkbook.VBProject.References If ref.IsBroken Then Debug.Print ref.Name & " is broken" Next End Sub Rob "Qasim Ahmad" wrote in message om... Hi everyone, Can someone please help me out here. I'm trying to check is all the project references are valid for a VBA piece of code i have written and need to distribute. Currently, if there is a broken reference, the vba just ends up spiting out a runtime error. Is there an elegant way to check for this through the code. I did see examples using VBPRoject, but i am not using this object. im using pure vba. Thanks in advance :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to check for project references in VBA
Thanks! another problem i was having was that i was not referencing
the Microsoft Visual Basic Extensibitiy library, which allows me to use the VBProject object. Once i figured that out, the code below works. thanks again. "Rob van Gelder" wrote in message ... Qasim, Sub testit() Dim ref As Object For Each ref In ThisWorkbook.VBProject.References If ref.IsBroken Then Debug.Print ref.Name & " is broken" Next End Sub Rob "Qasim Ahmad" wrote in message om... Hi everyone, Can someone please help me out here. I'm trying to check is all the project references are valid for a VBA piece of code i have written and need to distribute. Currently, if there is a broken reference, the vba just ends up spiting out a runtime error. Is there an elegant way to check for this through the code. I did see examples using VBPRoject, but i am not using this object. im using pure vba. Thanks in advance :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Missing VBA Project References for non-VBA commands | Excel Discussion (Misc queries) | |||
VB Project References | Excel Discussion (Misc queries) | |||
unlock project with VBA code | Excel Programming | |||
Discussion: VBA Project Code Protection | Excel Programming | |||
inserted code into project but can't run it in run dialogbox | Excel Programming |