ThisWorkbook.Path & Windows Vista

T

Tom

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
 
J

JLatham

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top