ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ThisWorkbook.Path & Windows Vista (https://www.excelbanter.com/excel-programming/401679-thisworkbook-path-windows-vista.html)

Tom

ThisWorkbook.Path & Windows Vista
 
Hello

I am using Windows Vista and Excel 2000, XP, 2003 & 2007.

Now I created an Excel add-in and copied it to the following directory:

C:\Programme\XY\


At next I opened this Excel file and went to the Visual Basic editor. I
entered the command "ThisWorkbook.Path" to test where my add-in is stored -
the system returned the following path:

C:\Program Files\XY\


?!?!? I do not have such a directory (Programme is the german name of
Program Files). I suppose that this has something to do with Windows Vista.
How can I get the path of my add-in Windows Vista? The command has to run in
Windows XP & Windows Vista? Many thanks in advance.

Thomas


JLatham

ThisWorkbook.Path & Windows Vista
 
Try putting this code into a module in your workbook and running it and see
what results you get. It may be that what you're seeing is a 'translation'
of the path name being done internally by the system instead of it just
making up a non-existant path.
Sub TestPaths()
Dim anyFile As String
Dim thisFile As String
thisFile = ThisWorkbook.FullName
anyFile = Dir$(thisFile)
If anyFile < "" Then
MsgBox "Found the file: " & anyFile & vbCRLF & "at: " & thisFile
Else
MsgBox "Could not find file: " & anyFile & vbcrlf & "in: " & thisFile
End If
End Sub


"Tom" wrote:

Hello

I am using Windows Vista and Excel 2000, XP, 2003 & 2007.

Now I created an Excel add-in and copied it to the following directory:

C:\Programme\XY\


At next I opened this Excel file and went to the Visual Basic editor. I
entered the command "ThisWorkbook.Path" to test where my add-in is stored -
the system returned the following path:

C:\Program Files\XY\


?!?!? I do not have such a directory (Programme is the german name of
Program Files). I suppose that this has something to do with Windows Vista.
How can I get the path of my add-in Windows Vista? The command has to run in
Windows XP & Windows Vista? Many thanks in advance.

Thomas



All times are GMT +1. The time now is 04:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com