Share via

Shared library path in VBA Declare statement.

Anonymous
2016-03-02T21:21:23+00:00

Is there a way to reference a relative path in a VBA Declare statement?  I have a shared library that I want others to be able to use when I send them the Excel file and the dylib file.  I don't want everyone to have to open the VBA editor and change the path to where they have it saved.  So instead of:

Declare Sub Test Lib ":user:name:location:lib.dylib" (ByVal....

I'd like it to automatically search for the dylib in whatever folder the Excel file is located.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Jim G 134K Reputation points MVP Volunteer Moderator
    2016-03-06T04:12:37+00:00

    You're in luck! Excel MVP Ron DeBruin has made a page that explains how to deal with sandboxing and saving files

    http://www.rondebruin.nl/mac/mac034.htm

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-03-03T14:37:07+00:00

    I'll be sending it to people to put on their separate computers.  I don't want to have to explain to them how to show hidden folders and then place the library in a specific folder.  Plus, supposedly, Excel should be looking for the library in the current Excel folder anyway.  At least that's what MS says for the PC.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-03-02T23:04:05+00:00

    I think it needs to be an absolute path, not a relative path. This is probably complicated with sandboxing. You should put the lib in a place common to all of your users.

    Was this answer helpful?

    0 comments No comments