Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 15th, 2005, 12:27 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default Finding user's home directory path

Is there a simple way in VBA to determine the filesystem path to the user's home (or My Documents) directory?

We have an Excel VBA script that will run on a shared machine that needs to write files to the logged-in user's My Documents. If it complicates the matter any, the user's My Documents are mapped to a Windows file server rather than being located on the local hard drive.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
__________________
Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
 
Old July 16th, 2005, 05:15 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Bruce,

Take a look at this link
http://blogs.officezealot.com/charle...2/10/3574.aspx

I think you can find the answer for your question

-vemaju

 
Old July 18th, 2005, 04:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Use the WSH objects:
    Set oShell = CreateObject("WScript.Shell")
    sMyDocs = oShell.SpecialFolders("MyDocuments")

rgds
Phil
 
Old July 18th, 2005, 09:23 AM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by pgtips
 Use the WSH objects:
    Set oShell = CreateObject("WScript.Shell")
    sMyDocs = oShell.SpecialFolders("MyDocuments")

rgds
Phil
Thanks, that worked perfectly.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding HTTP Directory structure attacks... ashokparchuri C# 1 January 28th, 2008 10:06 AM
Selecting the path directory yukijocelyn ASP.NET 2.0 Basics 1 October 8th, 2007 10:22 PM
how to take User's Full Name from Active Directory krisshnaprabhu General .NET 0 May 31st, 2006 12:59 AM
how to take User's Full Name from Active Directory krisshnaprabhu ASP.NET 1.0 and 1.1 Professional 0 May 31st, 2006 12:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.