Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default save as - to any desktop

Hello,
The code below works for me, but how do I :
a.) Make this WB "save as" a copy to any individuals desktop? in other
words what can I use for a wildcard for the " XXX" in XXX.TRGROUP. (XXX would
be a name like jsmith, jdoe etc)
and b.) How can this be done as soon as the WB is opened from the original
read only file, so once opened, it saves a copy directly to the PC's desktop
- without prompting-?


ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\XXX.TRGROUP\Desktop\copy of.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False


Your help is as always greatly appreciated.
Thank you
Driftwood
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default save as - to any desktop

DeskTop = environ("UserProfile")

will give

"C:\Documents and Settings\jsmith


DeskTop = environ("UserProfile")
bkname = ".TRGROUP\Desktop\copy of.xls"
ActiveWorkbook.SaveAs Filename:= DeskTop & bkname, _
FileFormat:= xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

"Driftwood" wrote:

Hello,
The code below works for me, but how do I :
a.) Make this WB "save as" a copy to any individuals desktop? in other
words what can I use for a wildcard for the " XXX" in XXX.TRGROUP. (XXX would
be a name like jsmith, jdoe etc)
and b.) How can this be done as soon as the WB is opened from the original
read only file, so once opened, it saves a copy directly to the PC's desktop
- without prompting-?


ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\XXX.TRGROUP\Desktop\copy of.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False


Your help is as always greatly appreciated.
Thank you
Driftwood

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default save as - to any desktop

Thank You Joel.
Took me a few minutes to realize that the ".TRGROUP" was actually part of
the UserProfile I had to delete it because it was trying to use
"jsmith.TRGROUP.TRGROUP"
So now it is:
bkname = "\Desktop\copy of.xls"
And works just GREAT!
Cheers to all the great responders out here!
Driftwood

"Joel" wrote:

DeskTop = environ("UserProfile")

will give

"C:\Documents and Settings\jsmith


DeskTop = environ("UserProfile")
bkname = ".TRGROUP\Desktop\copy of.xls"
ActiveWorkbook.SaveAs Filename:= DeskTop & bkname, _
FileFormat:= xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

"Driftwood" wrote:

Hello,
The code below works for me, but how do I :
a.) Make this WB "save as" a copy to any individuals desktop? in other
words what can I use for a wildcard for the " XXX" in XXX.TRGROUP. (XXX would
be a name like jsmith, jdoe etc)
and b.) How can this be done as soon as the WB is opened from the original
read only file, so once opened, it saves a copy directly to the PC's desktop
- without prompting-?


ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\XXX.TRGROUP\Desktop\copy of.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False


Your help is as always greatly appreciated.
Thank you
Driftwood

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
Desktop Save Question Jenny B. Excel Discussion (Misc queries) 7 March 26th 08 01:49 AM
difficulties using vba to save to the desktop ArielZusya Excel Programming 4 November 6th 07 05:24 PM
Save to default desktop Mark Excel Discussion (Misc queries) 7 August 14th 05 01:04 PM
Save .xls as .txt In DeskTop Antonyo[_2_] Excel Programming 3 July 18th 05 01:52 PM
How do I save to the desktop across OS's? Greg Little Excel Programming 2 December 14th 04 10:40 PM


All times are GMT +1. The time now is 10:11 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"