Quote:
Originally Posted by p45cal
try changing:
Code:
filename = ThisWorkbook.Path & Application.PathSeparator & "TestImportFile1.xlsx"
to the likes of:
Code:
filename = "C:\Users\John Smith\Desktop\Test import file\DifferentFolderf\TestImportFile2.xlsx"
|
Hi p45cal. I do not recommend using such a "rigid" solution when referring to Desktop. For me, the path to Desktop is:
"C:\Users\<prifile_name>\
SkyDrive\Pulpit". (Polish version
)
I rather recommend it:
Code:
Sub AAA()
MsgBox GetDesktopPath & "Test import file\DifferentFolder\TestImportFile2\"
End Sub
Function GetDesktopPath()
Dim WSHShell As Object
Set WSHShell = CreateObject("Wscript.Shell")
GetDesktopPath = WSHShell.SpecialFolders(4)
If Right(GetDesktopPath, 1) <> Application.PathSeparator Then
GetDesktopPath = GetDesktopPath & Application.PathSeparator
End If
End Function
Artik