0

I have made an addin and placed it on a shared networking drive.

The addin contains a seperat sub that calls the addin whenever an excel document is opened, so the addin will be available in excel all the time.

The addin works fine when i am in my office and when i am connected, however if i for example work from home, and opens excel, then excel gives me the following error: "Sorry we couldn't find . Is it possible it was moved, renamed or deleted?" This is because i am not connected and excel cannot retrieve the path i am trying to call the addin from.

Is there a way to handle this error, so the message dont show up? I have tried to ignore the error so the message dont show up but that does not work. How can i exit the sub before the error appears? or an even better solution is to call custom made addins without using a specific networking drive as location.

I have tried the following code to ignore the error.


Sub Open_up () 

Application.DisplayAlerts = False

On Error Resume Next 

Call 'name of the addin 

End Sub ```

Hope it makes sense
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Lasse
  • 1
  • 1
  • Before you call the Addin, check that the path is valid first e.g. `If Dir([path]) <> "" Then [Call addin etc] Else [do something else if path not valid]` – Raymond Wu May 31 '22 at 07:25
  • Hey Raymond, thanks for the suggestion. I tried the below but i still get the error when i am not connected, `Dim path As String path = "V:\Add_Ins\Addins.xlam" If Dir([path]) <> "" Then Call CreateMenuMaker Else Exit Sub End If` – Lasse May 31 '22 at 08:00
  • By error, do you mean the same error ("Sorry we couldn't find . Is it possible it was moved, renamed or deleted?")? `Dir([path])` should be `Dir(path)` – Raymond Wu May 31 '22 at 08:04
  • I changed to `Dir(path)` and the same error still occurs. Yes it is still "Sorry we couldn't find . Is it possible it was moved, renamed or deleted?" – Lasse May 31 '22 at 08:14
  • I guess it is because i have added the add-in, in excel under options->Add-in->Manage Excel add-in->Go and then a check mark at the specific add-in. So whenever i am disconnected then it cant find the addin and that has nothing to do with the sub calling it. It is the location of the path of the disconnected networking drive – Lasse May 31 '22 at 08:20

1 Answers1

0

It looks like the add-in was not loaded and not accessible from the shared drive. I'd suggest creating an installer for the add-in, so it could be installed on the end user machines. See Deploy an Office solution by using Windows Installer for more information.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45