Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 17 Feb 2009 20:04:01 -0800, OssieMac
wrote: Hi John, Is this what you are looking for? Application.Dialogs(xlDialogSaveAs).Show Not quite. That opens the dialogue box which is what I need in order to let a user select the location but I want to set the filename to something different than what the current workbook name is. John Keith |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this should save it to whatever name you give it, if that's what you want.
you'll need to supply the path, too. activeworkbook.SaveAs "YourFilename.xls" -- Gary K "John Keith" wrote in message ... On Tue, 17 Feb 2009 20:04:01 -0800, OssieMac wrote: Hi John, Is this what you are looking for? Application.Dialogs(xlDialogSaveAs).Show Not quite. That opens the dialogue box which is what I need in order to let a user select the location but I want to set the filename to something different than what the current workbook name is. John Keith |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Wed, 18 Feb 2009 00:15:44 -0500, "Gary Keramidas"
wrote: this should save it to whatever name you give it, if that's what you want. you'll need to supply the path, too. activeworkbook.SaveAs "YourFilename.xls" Obviously I wasn't clear enough on my original post. :-( I want the user to select the path but the new file name is fixed and is different from what the currentl workbook is. My co-worker, who will also be using this macro, likes to save files to her desktop, while I like to put items in My Documents. So I want to use the save as so that each of us can can pick the location that matches our preferences. The file name needs to be different from the current name because this is actually one part of a multi part operation and after each step the current contents of the workbook are saved under a different filename. I did all the development work on this macro and set it up to save the resulting files to My Documents and it wasn't until today when I shared it with my co-worker that she asked "can it save to my desktop?". John Keith |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
zorvek posted this excellent method at Experts-Exchange, and there are some
other methods too. There is a non-trivial amount of code here, but you can just paste this in a new module and use it immediately...it is easy to use and flexible. http://www.experts-exchange.com/Soft..._23560018.html -- Tim Zych http://www.higherdata.com "John Keith" wrote in message ... On Wed, 18 Feb 2009 00:15:44 -0500, "Gary Keramidas" wrote: this should save it to whatever name you give it, if that's what you want. you'll need to supply the path, too. activeworkbook.SaveAs "YourFilename.xls" Obviously I wasn't clear enough on my original post. :-( I want the user to select the path but the new file name is fixed and is different from what the currentl workbook is. My co-worker, who will also be using this macro, likes to save files to her desktop, while I like to put items in My Documents. So I want to use the save as so that each of us can can pick the location that matches our preferences. The file name needs to be different from the current name because this is actually one part of a multi part operation and after each step the current contents of the workbook are saved under a different filename. I did all the development work on this macro and set it up to save the resulting files to My Documents and it wasn't until today when I shared it with my co-worker that she asked "can it save to my desktop?". John Keith |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't understand John.
Your question was "Is it possible to open the file save as dialog window and change the name of the file from the current name?" You can change the file name in the dialog box as well select the location for the file. -- Regards, OssieMac "John Keith" wrote: On Tue, 17 Feb 2009 20:04:01 -0800, OssieMac wrote: Hi John, Is this what you are looking for? Application.Dialogs(xlDialogSaveAs).Show Not quite. That opens the dialogue box which is what I need in order to let a user select the location but I want to set the filename to something different than what the current workbook name is. John Keith |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 17 Feb 2009 22:08:09 -0800, OssieMac
wrote: I don't understand John. Your question was "Is it possible to open the file save as dialog window and change the name of the file from the current name?" You can change the file name in the dialog box as well select the location for the file. I don't want the user to fill in the name of the file. I want the macro to fill in the name of the file but I want the user to select the path to where that file will be saved. John Keith |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 17 Feb 2009 23:22:09 -0700, John Keith wrote:
I don't want the user to fill in the name of the file. I want the macro to fill in the name of the file but I want the user to select the path to where that file will be saved. BTW, I did do some web searching before posting here to see if I could find a solution. I did find some examples of the same question I am asking but none of the responses solved the problem. I'm hoping the experts lurking here will have an idea. Anyway, thanks all for looking so far. I've got to turn in now, a very early appointment tomorrow. John Keith |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi -
Try the following please and see if that works. -good luck Sub dlg_test1() Const c_fType = ".xls" Dim var_FileName As Variant Dim sNewFile As String var_FileName = Empty sNewFile = "MyNewFile" & c_fType var_FileName = Application.GetSaveAsFilename( _ InitialFileName:=sNewFile, _ fileFilter:="Microsoft Excel Workbook (*" & c_fType & "), *" & c_fType, _ Title:="MyApp Save As...") If var_FileName = False Then Exit Sub If Len(CStr(var_FileName)) = 0 Then Exit Sub ' DO WHATEVER HERE var_FileName = Empty End Sub "OssieMac" wrote: I don't understand John. Your question was "Is it possible to open the file save as dialog window and change the name of the file from the current name?" You can change the file name in the dialog box as well select the location for the file. -- Regards, OssieMac "John Keith" wrote: On Tue, 17 Feb 2009 20:04:01 -0800, OssieMac wrote: Hi John, Is this what you are looking for? Application.Dialogs(xlDialogSaveAs).Show Not quite. That opens the dialogue box which is what I need in order to let a user select the location but I want to set the filename to something different than what the current workbook name is. John Keith |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to save file as different filename | Excel Worksheet Functions | |||
Date Filename Save as Dialog Macro Thingy!!!!!! | Excel Programming | |||
Save file as filename plus fieldname | Excel Programming | |||
Save filename as new file name | Excel Programming | |||
Filename has Url in file-save dialog when saving exported Excel do | Excel Programming |