Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving Excel Icon to Desktop | Excel Discussion (Misc queries) | |||
Desktop Saving in VB | Excel Programming | |||
VBA code for: Saving to desktop? | Excel Programming | |||
How to install a workbook as a shortcut on the desktop programmatically | Excel Programming | |||
workbook creates desktop shortcut...HELP | Excel Programming |