Hello there,
I need your kind help. I have created an excel spreadsheet that will be used by multiple users. Upon clicking the submit button, I want excel macro to save the file to a default location (without using the save as dialog box), thus users do not have to save the file themselves.
Thanks in advance for assistance
Taha
| Title | Under | Posted on |
|---|---|---|
| how to create application status in peoplesoft campus solutions 8.9 version | PeopleSoft Functional | 05/17/2012 - 4:09am |
| horizantal text in charts | PeopleSoft Technical | 05/10/2012 - 4:57am |
| no current buffer context error | PeopleSoft Technical | 05/10/2012 - 1:19am |
| Integration Broker : Operating Instance/Pub Contracts/Sub Contracts | PeopleSoft Technical | 04/24/2012 - 11:05am |
Hi there,
Try the following function behind your save button. It will save the file as a .txt file in c:\temp\ and append today's date to it.
' file name
filnm = "c:\temp\" + VBA.Strings.Format(Now, "yyyymmdd") + ".txt")
' Save file
ActiveWorkbook.SaveAs Filename:=filnm, FileFormat:= _
xlText, CreateBackup:=False
End Sub
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Thanks so much my friend.
Just another question please. I created a button to activate the macro using thie code with slight modification. Can in some way this button could perform simultaneous actions i.e. Save the file to a default location and email it to the administrator as well?
Thanks again for your help.
Taha, what's behind your button is "code" and you can do as many actions as you want. However, I'm not a VB expert and would have no idea how to code emails to get fired from an excel sheet. If you ever figure that out, I would appreciate it if you post is back on here for us to see!
Good luck!
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Thanks for reply. I will definitley let you all know when I have a solution
Cheers,
I agree with the idea of Lepa,
Sub save_default()
' file name
filnm = "c:\temp\" + VBA.Strings.Format(Now, "yyyymmdd") + ".txt")
' Save file
ActiveWorkbook.SaveAs Filename:=filnm, FileFormat:= _
xlText, CreateBackup:=False
End Sub
"Life is too short to run proprietary software."
Post new comment