Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default how to save file on different computers

Hello,

I'm just finishing up programming my file and i'm stuck. I need to
automatically save this file on Desktop for example but it will be used on
different computers. Directory names will be different. They are all running
windows OS.
For example:
c:\Documents and settings\User name\Desktop
"User name" folder will be different on every computer. Is there any way to
point my code to save in "Desktop" folder directly?
Thanks for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default how to save file on different computers

I don't like saving things to the desktop but there are times when it makes
sense. The following lines will give you the path to the desktop on
whatever PC the code is being run.

Const Desktop = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFldrDesk = objShell.Namespace(Desktop)
strDeskPath = objFldrDesk.Self.Path & "\"


Steve Yandl



"Graff" wrote in message
...
Hello,

I'm just finishing up programming my file and i'm stuck. I need to
automatically save this file on Desktop for example but it will be used on
different computers. Directory names will be different. They are all
running
windows OS.
For example:
c:\Documents and settings\User name\Desktop
"User name" folder will be different on every computer. Is there any way
to
point my code to save in "Desktop" folder directly?
Thanks for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default how to save file on different computers

Thanks for your help Steve.
Everything works as it should.
I just had to replace strDeskPath with SPath, so the result looks something
like:

ActiveWorkbook.SaveAs Filename:=SPath & mon.Range("A101").Value & " Daily "
& Format(sun.Range("A1").Value, "mm-dd-yy") & ".xls"

There's something else that bothers me with the auto save procedure. Say you
are saving a file with a name that already exists, it will ask you to
overwrite. You say yes, it overwrites, you say no, it will give you a run
time error. I just started working with VB so i'm not that great at it yet.
Although a chance of this scenario taking place is zero, i'd like to have
something done with the code to overcome this bug. Any ideas on that?

Thanks again for your help,

"Steve Yandl" wrote:

I don't like saving things to the desktop but there are times when it makes
sense. The following lines will give you the path to the desktop on
whatever PC the code is being run.

Const Desktop = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFldrDesk = objShell.Namespace(Desktop)
strDeskPath = objFldrDesk.Self.Path & "\"


Steve Yandl



"Graff" wrote in message
...
Hello,

I'm just finishing up programming my file and i'm stuck. I need to
automatically save this file on Desktop for example but it will be used on
different computers. Directory names will be different. They are all
running
windows OS.
For example:
c:\Documents and settings\User name\Desktop
"User name" folder will be different on every computer. Is there any way
to
point my code to save in "Desktop" folder directly?
Thanks for your help.




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
opening same excel file at different computers in real time Clark kent Excel Discussion (Misc queries) 4 October 14th 08 10:35 PM
Why doesn't my file open in other computers? plilino Excel Discussion (Misc queries) 0 January 25th 08 08:23 PM
Same file & printer, different computers & results Bob Johnson Excel Discussion (Misc queries) 5 May 3rd 07 03:24 PM
Editing the same file from two computers at the same time Ryan Setting up and Configuration of Excel 1 February 20th 07 01:26 PM
Data Entry in the same file by 2 computers Chris Excel Programming 1 November 16th 04 09:46 AM


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

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

About Us

"It's about Microsoft Excel"