ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to save to My Documents folder on different PCs (https://www.excelbanter.com/excel-worksheet-functions/7868-how-save-my-documents-folder-different-pcs.html)

Matthew

how to save to My Documents folder on different PCs
 
How do I setup a macro that will save to the "My Documents" folder even
though the path is different on different PC's. Since Win-XP moved the "My
Docs" folder to a differnet place for each user.
--
Respectfully
Matthew Russell

Dave Peterson

One way:

Option Explicit
Sub testme()
Dim myDocumentsPath As String

Dim wsh As Object

Set wsh = CreateObject("WScript.Shell")
myDocumentsPath = wsh.SpecialFolders.Item("mydocuments")

MsgBox myDocumentsPath

End Sub

Matthew wrote:

How do I setup a macro that will save to the "My Documents" folder even
though the path is different on different PC's. Since Win-XP moved the "My
Docs" folder to a differnet place for each user.
--
Respectfully
Matthew Russell


--

Dave Peterson


All times are GMT +1. The time now is 04:41 PM.

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