|
-
Feb 27th, 2001, 02:38 PM
#1
Thread Starter
New Member
Hi.
On my excel project, I am trying to create a macro which allows a user to save a spreadsheet.
WHat happens, is that i do not want the user saving the actual excel program (because it is a template), so I have created a 'Save' Macro, which copys the relevant information that they would want to save, and then creates a new workbook, and pastes the stuff in there.
Then, i want this workbook to popup a 'Save as' box.
THe reason why i can't do it, is because when i go to record a macro, it doesn't let me stop the macro when the 'save as' box is up. It only lets me stop it when i have either saved, or when I have clicked cancel.
So basically, i need the code to popup a save as box in excel, haha
Thanks for your help guys.
-AJ
BOYAKASHA! excel rules.. hmmm
-
Feb 27th, 2001, 03:30 PM
#2
Addicted Member
If you create a new document from a template in Excel you can save that document directly without fear of the template being damaged. That is the whole point of templates.
I would imagine you could use workbook.save or a similar method to invoke the save dialog
Regards
Matt Brown
Hamilton, NZ
VB6 C++ in Visual Studio 6sp4
VB.net Beta 1
-
Feb 27th, 2001, 03:51 PM
#3
Thread Starter
New Member
Yes Matt, you are right.
But thats not what I am talking about.
The whole reason I create a new workbook is so that I CAN save that easily, without saving over the template (i will have the template protected anyway).
But i want the user to be able to specify what they want to save the file as.
I'm basically a beginner in all this anyway, so I don't know how do anything.
I used your advice and Excel Help to discover ActiveWorkbook.Save
However, the problem with that, is that after I have created the new workbook, when the activeworkbook.save code is parsed, instead of showing the user the SAVE AS box, it automatically saves the workbook as something like book3.xls.
I want the user to be able to specify what they want to save it as, which obviously means the SAVE AS box.
So does anyone know how to do this?
Cheers,
AJ
BOYAKASHA! excel rules.. hmmm
-
Feb 27th, 2001, 06:58 PM
#4
Addicted Member
Interesting
try this code
Code:
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
ThisWorkbook.SaveAs fileSaveName
End If
Regards
Matt Brown
Hamilton, NZ
VB6 C++ in Visual Studio 6sp4
VB.net Beta 1
-
Feb 28th, 2001, 07:18 AM
#5
Thread Starter
New Member
sorted!
nice one matt.
solved it now 
cheer.
BOYAKASHA! excel rules.. hmmm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|