![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Save button - change save to folder I am looking to get a script where my users can click a "save" button. It opens up the "save as" dialog box similiar to the code below. The reason I like this format is, the actual file name is long and it shows the default format for the user to see so they name the file properly. Sub SaveAll1_Click() fileSaveName = Application.GetSaveAsFilename( _ InitialFileName:="Name - City, St - Cust# - YYYY-MM.xls", _ filefilter:="Excel Files (*.xls), *.xls", _ Title:="[SAVE AS] Name - City, St - Cust# - YYYY-MM.xls", _ ButtonText:="CLICK HERE TO SAVE") If fileSaveName <> False Then MsgBox "Save as " & fileSaveName End If End Sub The issue is, I want it to open up in a different folder so my users don't have to scroll through to find the proper folder to save it in everytime. To add to the fun, the folder location would be: C:\documents and settings\<userid>\desktop\folder\ Obviously the "<userid>" is all based on who is logged into the machine at the time. Anyone have any ideas? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Save button - change save to folder On Feb 25, 9:59*am, lonlyboy <lonly...@xxxxxx> wrote: Quote: > I am looking to get a script where my users can click a "save" button. > It opens up the "save as" dialog box similiar to the code below. *The > reason I like this format is, the actual file name is long and it > shows the default format for the user to see so they name the file > properly. > > Sub SaveAll1_Click() > fileSaveName = Application.GetSaveAsFilename( _ > * * InitialFileName:="Name - City, St - Cust# - YYYY-MM.xls", _ > * * filefilter:="Excel Files (*.xls), *.xls", _ > * * Title:="[SAVE AS] * Name - City, St - Cust# - YYYY-MM.xls", _ > * * ButtonText:="CLICK HERE TO SAVE") > If fileSaveName <> False Then > * * MsgBox "Save as " & fileSaveName > End If > End Sub > > The issue is, I want it to open up in a different folder so my users > don't have to scroll through to find the proper folder to save it in > everytime. *To add to the fun, the folder location would be: > C:\documents and settings\<userid>\desktop\folder\ > Obviously the "<userid>" is all based on who is logged into the > machine at the time. > > Anyone have any ideas? Here is some code to get the path of the desktop from whatever computer the script is run on: Const DESKTOP = &H10& Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(DESKTOP) Set objFolderItem = objFolder.Self Wscript.Echo objFolderItem.Path It's been a while since I've used Excel in a script, but there are news groups for that. You might want to try microsoft.public.excel.programming to as the question about how to get the dialog box to open in a particular directory. But if you want to force them to save to their desktop, why give a choice? You can use the desktop path a force a save using the plain "SaveAs" instead of "GetSaveAsFilename". HTH, Jennifer |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Change Default "Save As" Folder | Vista mail | |||
| Save As Button Wont Appear | Live Mail | |||
| SAVE AS button will not appear when added to ToolBar | Live Mail | |||
| Change default "Save" folder | Vista file management | |||
| How do i change default save folder ? | Vista file management | |||