spurs
Active Member
- Joined
- Oct 18, 2006
- Messages
- 479
- Office Version
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
I am writing VBA code that has to interact with a .dll file named master.dll which will be located on a USB memory stick (for example possibly drive E: F: or G:. In each case the subdirectory where master.dll is located will be in a subdirectory called Tickets
So the .dll file can be
any drive letter X followed by
X:\Tickets\Master.dll
The excel file containing the VBA code can be run from a different drive than where the Master.dll resides
I realize that I need a statement something like:
Private Declare Function MasterRT Lib "X:\Tickets\Master.dll" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
1) If I don't know the letter of the drive where the USB is plugged in; how should I code the above line?
2) How can I trap the error if Master.dll is not found or available ? If this is the case I want to properly shut down the macro.
So the .dll file can be
any drive letter X followed by
X:\Tickets\Master.dll
The excel file containing the VBA code can be run from a different drive than where the Master.dll resides
I realize that I need a statement something like:
Private Declare Function MasterRT Lib "X:\Tickets\Master.dll" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
1) If I don't know the letter of the drive where the USB is plugged in; how should I code the above line?
2) How can I trap the error if Master.dll is not found or available ? If this is the case I want to properly shut down the macro.