LockXLS On-line Help Library

Getting Started
Using LockXLS
How to ...
General Questions
Questions about LockXLS activation
Advanced Questions
LockXLS Runtime Menu
About LockXLS
Get path to application file

Get path to application file.

In some cases you need to know in which your file is located. For example: you distribute several files and one workbook opens another. If you file is converted to application, ThisWorkbook.FullName call does not help. It will point you to file in TEMP folder. To get right path you should use LockXLSRuntime.GetApplicationPath method.

LockXLSRuntime.GetApplicationPath( <Workbook Object> ) returns folder, where application file is located.

If this method is called from usual Excel file (locked or unlocked), it returns folder of the ThisWorkbook.FullName file.

Example of the VBA code, which uses this method:

' declare variable for LockXLS Runtime object
Dim oLockXLS As Object
' variable which contains path
Dim sPath As String
' create LockXLS Runtime object
Set oLockXLS = CreateObject("LockXLSRuntime.Connect")
' get path
sPath = oLockXLS.GetApplicationPath(ThisWorkbook)
' release LockXLS Runtime object
Set oLockXLS = Nothing
' show path to customer
MsgBox sPath

See Also

All methods of the LockXLS Runtime object