Hello!
can somebody explain to me, why I am getting error on this (path not found):
MkDir Environ("HOMEPATH") + "try"
msgbox shows it correctly...
Thank you
Hello!
can somebody explain to me, why I am getting error on this (path not found):
MkDir Environ("HOMEPATH") + "try"
msgbox shows it correctly...
Thank you
Should it be
[vba]
MkDir Environ("HOMEPATH") & Application.PathSeparator & "try"
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
hmm... i already tried that... still doesn't work...Originally Posted by xld
What does MkDir Environ("HOMEPATH") alone give you?
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
path not foundOriginally Posted by xld
So that suggest that you don't have such a variable set up does it not, so you cannot use it.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
How about trying this
[vba]
MkDir CreateObject("WScript.Shell").SpecialFolders(16) & application.PathSeparator & "try"
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
I think you need:
[VBA]MkDir Environ("HOMEDRIVE") & Environ("HOMEPATH") & Application.PathSeparator & "try"[/VBA]
Regards,
Rory
Microsoft MVP - Excel
thanx to all! it is working now!
"USERPROFILE" works for me.
For a listing, try
[VBA]Sub MyEnvirons()
For i = 1 To 100
Cells(i, 1) = Environ(i)
Next
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'