Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default SaveAs Question

I'm using
Activeworkbook.SaveAs.("C:Copyofthecurrent") to save a copy
on my desktop. If this runs on Win 98, works just fine. What happens
if it runs on Win 2k or XP, which have multiple users? Is the user an
issue or will it just save to the desktop, which is the desired
result? Also, what happens in the rare case that the user doesn't have
a C drive? I'd expect a macro error- How do I get around these
problems, if problems they are? TIA
Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default SaveAs Question

Greg,

I can't get your code snippet to compile.
However, the following code will place a shortcut to the active workbook on the desktop.
Maybe it will suit your needs...
'-----------------------------------------
Sub DesktopShortcut()
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String

Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\" & ActiveWorkbook.Name & ".lnk")

With MyShortcut
.TargetPath = ActiveWorkbook.FullName
' .IconLocation = "F:\Icons\Arrows\ARW03LT.ICO" 'your choice
.WindowStyle = 1 'not sure if needed
.Save
End With

Set WSHShell = Nothing
Set MyShortcut = Nothing
MsgBox "A shortcut has been placed on your desktop. ", vbInformation, " Primitive Software"
End Sub
'----------------------------------

Jim Cone
San Francisco, CA

"Greg Little" wrote in message om...
I'm using
Activeworkbook.SaveAs.("C:Copyofthecurrent") to save a copy
on my desktop. If this runs on Win 98, works just fine. What happens
if it runs on Win 2k or XP, which have multiple users? Is the user an
issue or will it just save to the desktop, which is the desired
result? Also, what happens in the rare case that the user doesn't have
a C drive? I'd expect a macro error- How do I get around these
problems, if problems they are? TIA
Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default SaveAs Question

My Bad, there's an extra period in there- should read

Activeworkbook.SaveAs ("C:Copyofthecurrent")

This should save a copy of the current workbook as whatever name is specified in
the quotes. What I'm after is making sure it is saved on the desktop.It has
previously done sounder Win 98, however it seems to want to put the copy in the
documents folder on XP. Is there a way to force it to the desktop on later
versions of windows, which include multiple users?


On Sun, 5 Dec 2004 18:01:09 -0800, "Jim Cone" wrote:

Greg,

I can't get your code snippet to compile.
However, the following code will place a shortcut to the active workbook on the desktop.
Maybe it will suit your needs...
'-----------------------------------------
Sub DesktopShortcut()
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String

Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\" & ActiveWorkbook.Name & ".lnk")

With MyShortcut
.TargetPath = ActiveWorkbook.FullName
' .IconLocation = "F:\Icons\Arrows\ARW03LT.ICO" 'your choice
.WindowStyle = 1 'not sure if needed
.Save
End With

Set WSHShell = Nothing
Set MyShortcut = Nothing
MsgBox "A shortcut has been placed on your desktop. ", vbInformation, " Primitive Software"
End Sub
'----------------------------------

Jim Cone
San Francisco, CA

"Greg Little" wrote in message om...
I'm using
Activeworkbook.SaveAs.("C:Copyofthecurrent") to save a copy
on my desktop. If this runs on Win 98, works just fine. What happens
if it runs on Win 2k or XP, which have multiple users? Is the user an
issue or will it just save to the desktop, which is the desired
result? Also, what happens in the rare case that the user doesn't have
a C drive? I'd expect a macro error- How do I get around these
problems, if problems they are? TIA
Greg


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default SaveAs Question

Greg,

Did you try the code I supplied?
In any case, I recorded a macro and saved a new workbook to the desktop.
This is what I got...

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\user\Desktop\Book2.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

Regards,
Jim Cone
San Francisco, USA

"Greg Little" wrote in message ...
My Bad, there's an extra period in there- should read
Activeworkbook.SaveAs ("C:Copyofthecurrent")
This should save a copy of the current workbook as whatever name is specified in
the quotes. What I'm after is making sure it is saved on the desktop.It has
previously done sounder Win 98, however it seems to want to put the copy in the
documents folder on XP. Is there a way to force it to the desktop on later
versions of windows, which include multiple users?


On Sun, 5 Dec 2004 18:01:09 -0800, "Jim Cone" wrote:
Greg,
I can't get your code snippet to compile.
However, the following code will place a shortcut to the active workbook on the desktop.
Maybe it will suit your needs...
'-----------------------------------------
Sub DesktopShortcut()
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\" & ActiveWorkbook.Name & ".lnk")
With MyShortcut
.TargetPath = ActiveWorkbook.FullName
' .IconLocation = "F:\Icons\Arrows\ARW03LT.ICO" 'your choice
.WindowStyle = 1 'not sure if needed
.Save
End With
Set WSHShell = Nothing
Set MyShortcut = Nothing
MsgBox "A shortcut has been placed on your desktop. ", vbInformation, " Primitive Software"
End Sub
'----------------------------------
Jim Cone
San Francisco, CA

"Greg Little" wrote in message om...
I'm using
Activeworkbook.SaveAs.("C:Copyofthecurrent") to save a copy
on my desktop. If this runs on Win 98, works just fine. What happens
if it runs on Win 2k or XP, which have multiple users? Is the user an
issue or will it just save to the desktop, which is the desired
result? Also, what happens in the rare case that the user doesn't have
a C drive? I'd expect a macro error- How do I get around these
problems, if problems they are? TIA
Greg


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
Excel 2007 question involving SaveAs to .XLS Kirk Bubul Excel Discussion (Misc queries) 3 October 17th 09 03:01 PM
Saveas VBA question Lost Excel Discussion (Misc queries) 1 June 2nd 09 07:51 AM
More help with SaveAs Glen Mettler[_2_] Excel Programming 2 February 14th 04 02:50 AM
Question Using SaveAs Method R3df1sh Excel Programming 1 November 12th 03 07:26 PM
SaveAs,csv popo pop Excel Programming 2 October 31st 03 06:08 AM


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