PDA

View Full Version : Unselect missing line in "References VBAProject"



DadiCool
06-03-2012, 07:43 AM
Hello,

I have to protect Sheet and VBAProject before deploying the Excel file for end users. (They cannot change anything, otherwize I can not give them support).
Time to time, when user try to run Macro, they have an error message ...
I have to unprotect VBAProject and unselect Missing lines , and the macro works..
I try to found a solution to check by Macro if Some lines are missed, and unselect them automatically (at the start of the Macro).
The missing lines are always about "Client Access Expres", all users have it installed, because the use of Macro is uploading information to the host system (IBM. AS400), and Client Access Express is the program we use to Emulate session on this Host.
(See attached file with different screen)

If someone can help.
Thanks in advance

Bob Phillips
06-03-2012, 08:22 AM
Sounds like your version and the users versions are out of sync. If that app supports automation (I assume it does), you could try late-binding. Instead of

Dim myCAE as ClientAccessEXpress 'or object name

use

Dim myCAE As Object

and instantiate it like so

Set myCAE =CreateObject("ClientAccessExpress.Application") 'or whatever

instead of

Set myCAE = New ClientAccessExpress

You will need to find the actual library names, I have no idea.

DadiCool
06-03-2012, 10:43 AM
Hello Xld, and thanks for your quick answer.
My English is not good, i'm sorry.

My need is to remove Missing References :
When I modify the excel with Macro, probably it identify that some program are installed on my computer and it keep my setting.
Now, the end user that not have those program on his computer, and don't need them to use my Excel.
I would like to add (at the begenning of my Macro, a part of code that could remove (unselect all references are identified as misssing), I don't wont to add them.

I hope you can understand (If not, I will ask my dother to translate in good English, she is a teacher).

Thanks a lot and have a good evening.

Bob Phillips
06-03-2012, 03:17 PM
Another person having a program that you do not is rarely a problem. What is a problem is when you have different versions of a program that you reference, that is what I was referring to.