LockXLS On-line Help Library

no items
folder
folder
folder
folder
no items
no items
no items

Get path to application file.

Excel File Compiler Screenshot

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