Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wrote some VBA for a co-worker and everything was pretty simple because I
knew she was using Windows 98 and the location of the My Documents folder could be accessed with "C:\My Documents". But now, I have been asked to make this work for others that may be using Windows 2000 or windows XP. I have realized that the location of the My Documents folder on Windows XP is "C:\Documents and Settings\Ken\My Documents". Now I realize I need to somehow test for or determine the location of the My Documents folder. Can someone please suggest an online article about this or give me some suggestions? Thanks, Ken |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
why don't you use doc and settings\all users\documents? that's a shared
resource for anyone that logs in -- Gary "Ken Loomis" wrote in message ... I wrote some VBA for a co-worker and everything was pretty simple because I knew she was using Windows 98 and the location of the My Documents folder could be accessed with "C:\My Documents". But now, I have been asked to make this work for others that may be using Windows 2000 or windows XP. I have realized that the location of the My Documents folder on Windows XP is "C:\Documents and Settings\Ken\My Documents". Now I realize I need to somehow test for or determine the location of the My Documents folder. Can someone please suggest an online article about this or give me some suggestions? Thanks, Ken |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ken:
See: Application.DefaultFilePath --- Regards, Norman "Ken Loomis" wrote in message ... I wrote some VBA for a co-worker and everything was pretty simple because I knew she was using Windows 98 and the location of the My Documents folder could be accessed with "C:\My Documents". But now, I have been asked to make this work for others that may be using Windows 2000 or windows XP. I have realized that the location of the My Documents folder on Windows XP is "C:\Documents and Settings\Ken\My Documents". Now I realize I need to somehow test for or determine the location of the My Documents folder. Can someone please suggest an online article about this or give me some suggestions? Thanks, Ken |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ken,
Try this Dim oWSH As Object Const wsh_SPECIAL_FOLDER_MY_DOCS As Long = 16 Set oWSH = CreateObject("WScript.Shell") MsgBox oWSH.SpecialFolders(wsh_SPECIAL_FOLDER_MY_DOCS) -- HTH Bob Phillips "Ken Loomis" wrote in message ... I wrote some VBA for a co-worker and everything was pretty simple because I knew she was using Windows 98 and the location of the My Documents folder could be accessed with "C:\My Documents". But now, I have been asked to make this work for others that may be using Windows 2000 or windows XP. I have realized that the location of the My Documents folder on Windows XP is "C:\Documents and Settings\Ken\My Documents". Now I realize I need to somehow test for or determine the location of the My Documents folder. Can someone please suggest an online article about this or give me some suggestions? Thanks, Ken |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ken,
Try the code below. HTH, Bernie MS Excel MVP Sub test() Dim MyFilePath As String MyFilePath = MyPCpath("MyDocuments") MsgBox "The path is " & MyFilePath End Sub Public Function MyPCpath$(Folder) MyPCpath = CreateObject("WScript.Shell").SpecialFolders _ (Folder) & Application.PathSeparator End Function "Ken Loomis" wrote in message ... I wrote some VBA for a co-worker and everything was pretty simple because I knew she was using Windows 98 and the location of the My Documents folder could be accessed with "C:\My Documents". But now, I have been asked to make this work for others that may be using Windows 2000 or windows XP. I have realized that the location of the My Documents folder on Windows XP is "C:\Documents and Settings\Ken\My Documents". Now I realize I need to somehow test for or determine the location of the My Documents folder. Can someone please suggest an online article about this or give me some suggestions? Thanks, Ken |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ken
See Randy Birch's http://vbnet.mvps.org/code/browse/csidl.htm on this. It's VB6 code, so the form code needs some rewrite for VBA use. It's a great cross-version library for My Documents, temp folder, application data folder, program files, IE history, Start menu, Desktop, ... HTH. Best wishes Harald "Ken Loomis" skrev i melding ... I wrote some VBA for a co-worker and everything was pretty simple because I knew she was using Windows 98 and the location of the My Documents folder could be accessed with "C:\My Documents". But now, I have been asked to make this work for others that may be using Windows 2000 or windows XP. I have realized that the location of the My Documents folder on Windows XP is "C:\Documents and Settings\Ken\My Documents". Now I realize I need to somehow test for or determine the location of the My Documents folder. Can someone please suggest an online article about this or give me some suggestions? Thanks, Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete emty file names from "recent documents" Excel | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How do I move a document from "recent items" to "documents" | New Users to Excel | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |