Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating Folder Folder in My Documents VBA - HELP

Hi,

I am trying to find out how to create a folder in the My Documents folder.

I tried looking for system variables that could lead me to the location of
the my Documents folder, so that I coudl use mkdir and the path, but the
problem is, the my document is mapped to the server, and not to the
C:\documents and settings subfolders.

Will appreciate if i could get some help on this.

I will eventually want to create folders within the new folder in the My
Documents.

Thank you!

Ali


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Creating Folder Folder in My Documents VBA - HELP

I',m not sure ...you could record a macro & record the path that way.
"usuall" the desktop comes under the users path
C:\Documents and Settings\username
however, as with my organisation, teh users desktop is saved on a network,
privately accessible only bu th euser, so that th euser can log-on from any
station and have access to the correct applications.




Sub vars()
Dim index As Long
index = 1
On Error Resume Next
Do
Cells(index + 1, 1) = index
Cells(index + 1, 2) = Environ$(index)
index = index + 1
Loop Until Err.Number < 0
End Sub




"Ali" wrote:

Hi,

I am trying to find out how to create a folder in the My Documents folder.

I tried looking for system variables that could lead me to the location of
the my Documents folder, so that I coudl use mkdir and the path, but the
problem is, the my document is mapped to the server, and not to the
C:\documents and settings subfolders.

Will appreciate if i could get some help on this.

I will eventually want to create folders within the new folder in the My
Documents.

Thank you!

Ali



  #3   Report Post  
Posted to microsoft.public.excel.programming
moi moi is offline
external usenet poster
 
Posts: 27
Default Creating Folder Folder in My Documents VBA - HELP

Use WSHost for getting the full MyDocuments path, change to that dir and
create a new folder.

Public Sub addMyDocumentsDir()
Dim wShell, fso, strFldr As String
Set wShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strFldr = wShell.SpecialFolders("MyDocuments")
ChDir (strFldr)
fso.CreateFolder ("test123")
End Sub



"Ali" schreef in bericht
...
Hi,

I am trying to find out how to create a folder in the My Documents folder.

I tried looking for system variables that could lead me to the location of
the my Documents folder, so that I coudl use mkdir and the path, but the
problem is, the my document is mapped to the server, and not to the
C:\documents and settings subfolders.

Will appreciate if i could get some help on this.

I will eventually want to create folders within the new folder in the My
Documents.

Thank you!

Ali



  #4   Report Post  
Posted to microsoft.public.excel.programming
tj tj is offline
external usenet poster
 
Posts: 71
Default Creating Folder Folder in My Documents VBA - HELP

Thank you!! This worked great!

"moi" wrote:

Use WSHost for getting the full MyDocuments path, change to that dir and
create a new folder.

Public Sub addMyDocumentsDir()
Dim wShell, fso, strFldr As String
Set wShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strFldr = wShell.SpecialFolders("MyDocuments")
ChDir (strFldr)
fso.CreateFolder ("test123")
End Sub



"Ali" schreef in bericht
...
Hi,

I am trying to find out how to create a folder in the My Documents folder.

I tried looking for system variables that could lead me to the location of
the my Documents folder, so that I coudl use mkdir and the path, but the
problem is, the my document is mapped to the server, and not to the
C:\documents and settings subfolders.

Will appreciate if i could get some help on this.

I will eventually want to create folders within the new folder in the My
Documents.

Thank you!

Ali




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup cell for documents in a folder Marc Trumpi Excel Worksheet Functions 1 January 7th 10 01:17 PM
How do I print a LIST of documents in a folder littlebear20 Excel Discussion (Misc queries) 2 August 16th 06 11:44 PM
locking excel documents in a folder hoyt New Users to Excel 1 June 30th 06 05:49 PM
excel documents won't open from my documents folder Paul1961 Excel Discussion (Misc queries) 2 January 15th 06 05:31 PM
how to save to My Documents folder on different PCs Matthew Excel Worksheet Functions 1 December 14th 04 02:49 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"