Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do I save to the desktop across OS's?

I want to save a document under another name using VBA. How do I force
it to save to the desktop across OS's? Win 98, and ME don't have
users, W2k and XP do. Do I have to write a different version for the
various versions of Windows? TIA for the help.

Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default How do I save to the desktop across OS's?

If I understand you correctly, you want to know what the desktop path is:

Sub DeskTopPath()
Set objScr = CreateObject("WScript.Shell")
DeskTopPath = objScr.SpecialFolders("Desktop") & "\"
Set objScr = Nothing
MsgBox DeskTopPath
End Sub

Any document you save to the DeskTopPath appears as an icon on the desktop.
"Greg Little" wrote:

I want to save a document under another name using VBA. How do I force
it to save to the desktop across OS's? Win 98, and ME don't have
users, W2k and XP do. Do I have to write a different version for the
various versions of Windows? TIA for the help.

Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default How do I save to the desktop across OS's?

Hi,
I use VBscript for this in w95 , w98 , Me .Must be possible in VBA :

Set MyShell = Wscript.CreateObject("WScript.Shell")
Set MyFile = CreateObject("Scripting.FileSystemObject")
strDesktop = MyShell.SpecialFolders("Desktop")
MyFile.DeleteFile strDesktop & "\TheFileYouWantToDelete"

hth
Gys


"Greg Little" wrote in message
...
I want to save a document under another name using VBA. How do I force
it to save to the desktop across OS's? Win 98, and ME don't have
users, W2k and XP do. Do I have to write a different version for the
various versions of Windows? TIA for the help.

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
Desktop Save Question Jenny B. Excel Discussion (Misc queries) 7 March 26th 08 01:49 AM
Macro - Save file in Desktop Dileep Chandran Excel Worksheet Functions 2 December 1st 06 08:37 AM
Save to default desktop Mark Excel Discussion (Misc queries) 7 August 14th 05 01:04 PM
Save as not working for laptop to desktop Adra Excel Worksheet Functions 3 March 29th 05 10:55 PM
Save web page as desktop file from Excel/VBA ExcelMonkey[_152_] Excel Programming 1 June 17th 04 03:59 AM


All times are GMT +1. The time now is 08:01 PM.

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"