Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Make directory structure variable

A macro ends with saving the worksheet. It works for me, but but not for
other users that use my worksheet on their PC. I found my solution in the
knowledge base, but I cant find how to make it flexible.
My macro ends with:
ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Owner\My
Documents\VvEAH\Financ\2007\Bookdoc " & Format(Now, "yyyy-mm") & ".xls"
How do I adjust this statement to make it usefull for all users.
Thanks for your help.
Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Make directory structure variable

You can find the "my documents" path with something like:

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



Pepestru wrote:

A macro ends with saving the worksheet. It works for me, but but not for
other users that use my worksheet on their PC. I found my solution in the
knowledge base, but I cant find how to make it flexible.
My macro ends with:
ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Owner\My
Documents\VvEAH\Financ\2007\Bookdoc " & Format(Now, "yyyy-mm") & ".xls"
How do I adjust this statement to make it usefull for all users.
Thanks for your help.
Paul


--

Dave Peterson
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
File directory structure reorg strebor44 Links and Linking in Excel 1 July 2nd 08 08:50 AM
Creating Directory Structure from Cell Value [email protected] Excel Worksheet Functions 5 December 7th 07 09:33 PM
Create Directory Structure from Cell Value. [email protected] Excel Discussion (Misc queries) 0 December 3rd 07 09:02 PM
VLOOKUP - Saves entire directory structure Armatidge Excel Worksheet Functions 0 February 20th 07 01:53 AM
How to write directory structure to excel file suyog_linux Excel Programming 8 November 28th 06 09:00 PM


All times are GMT +1. The time now is 11:02 AM.

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"