Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 52
Default Saving a workbook into the desktop

Is it possible to code to save a file into a variable
directory?

ie: c:\documents and settings\variable computer
name\desktop

the code would search for the correct name and save the
Excel file to the desktop.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Saving a workbook into the desktop

Sure - assuming you can come up with the computer name,
store it in a string variable (e.g. CompName) and then

ActiveWorkbook.SaveAs "C:\Documents and Settings\" _
& CompName & "\Desktop",...

-----Original Message-----
Is it possible to code to save a file into a variable
directory?

ie: c:\documents and settings\variable computer
name\desktop

the code would search for the correct name and save the
Excel file to the desktop.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Saving a workbook into the desktop

I'm not sure how to search for the correct name, but this might get you started:

Option Explicit
Sub testme03()

Dim wsh As Object
Dim myPath As String

Set wsh = CreateObject("WScript.Shell")
myPath = wsh.SpecialFolders.Item("Desktop")

ActiveWorkbook.SaveAs Filename:=myPath & "\" & "whateveryouwant.xls", _
FileFormat:=xlWorkbookNormal

End Sub

Bob wrote:

Is it possible to code to save a file into a variable
directory?

ie: c:\documents and settings\variable computer
name\desktop

the code would search for the correct name and save the
Excel file to the desktop.


--

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
Saving Excel Icon to Desktop Candy Excel Discussion (Misc queries) 1 January 6th 07 10:08 PM
Desktop Saving in VB BOHICA Excel Programming 1 February 18th 04 01:26 AM
VBA code for: Saving to desktop? jasonsweeney[_37_] Excel Programming 2 February 3rd 04 12:17 PM
How to install a workbook as a shortcut on the desktop programmatically Belinda Excel Programming 1 January 23rd 04 07:11 AM
workbook creates desktop shortcut...HELP daredevil Excel Programming 0 November 13th 03 01:53 AM


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