ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove reference from code (https://www.excelbanter.com/excel-programming/311159-remove-reference-code.html)

Dr.Schwartz

Remove reference from code
 
My VBA project has a reference to an xla - lets call it external.xla. Not all
users of my VBA project has this xla installed. Is there any way to check the
existence of the xla from my code when the VBA project is opened. If it exist
it is placed in the folder C:\xlaStore.

If the xla does not exist I would like to remove the reference or perhaps
just ignore it in some way.

Thanks
The Doctor

Tom Ogilvy

Remove reference from code
 
Private Sub Workbook_Open()
if dir("C:\xlaStore\external.xla") = "" then
- xla does not exist
End if
End Sub

--
Regards,
Tom Ogilvy

"Dr.Schwartz" wrote in message
...
My VBA project has a reference to an xla - lets call it external.xla. Not

all
users of my VBA project has this xla installed. Is there any way to check

the
existence of the xla from my code when the VBA project is opened. If it

exist
it is placed in the folder C:\xlaStore.

If the xla does not exist I would like to remove the reference or perhaps
just ignore it in some way.

Thanks
The Doctor




Dr.Schwartz

Remove reference from code
 
Thanks Tom, however I still need the part that removes the reference

The Doctor

"Tom Ogilvy" wrote:

Private Sub Workbook_Open()
if dir("C:\xlaStore\external.xla") = "" then
- xla does not exist
End if
End Sub

--
Regards,
Tom Ogilvy

"Dr.Schwartz" wrote in message
...
My VBA project has a reference to an xla - lets call it external.xla. Not

all
users of my VBA project has this xla installed. Is there any way to check

the
existence of the xla from my code when the VBA project is opened. If it

exist
it is placed in the folder C:\xlaStore.

If the xla does not exist I would like to remove the reference or perhaps
just ignore it in some way.

Thanks
The Doctor





Tom Ogilvy

Remove reference from code
 
http://support.microsoft.com/default...29&Product=xlw
XL2000: How to Programmatically Create a Reference

shows how to both add and remove a reference.

--
Regards,
Tom Ogilvy


"Dr.Schwartz" wrote in message
...
Thanks Tom, however I still need the part that removes the reference

The Doctor

"Tom Ogilvy" wrote:

Private Sub Workbook_Open()
if dir("C:\xlaStore\external.xla") = "" then
- xla does not exist
End if
End Sub

--
Regards,
Tom Ogilvy

"Dr.Schwartz" wrote in message
...
My VBA project has a reference to an xla - lets call it external.xla.

Not
all
users of my VBA project has this xla installed. Is there any way to

check
the
existence of the xla from my code when the VBA project is opened. If

it
exist
it is placed in the folder C:\xlaStore.

If the xla does not exist I would like to remove the reference or

perhaps
just ignore it in some way.

Thanks
The Doctor








All times are GMT +1. The time now is 05:25 AM.

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