Not Before Save, But After Save Command Possible

Feb 26, 2007

I know that there is a command called "Private Sub Workbook_BeforeSave"

but is it possible to execute a routine after some one has saved?

so that each time a user selecteded save it would adn then routine this routine immediately afterwards?

for example:
say the routine was Run "Test" how would you incorporate this line into the command?

View 9 Replies


ADVERTISEMENT

VBA - Use Command Button To Obtain Save As Screen And Save As PDF

Jun 22, 2014

I have a UserForm in which i have inserted a CommandButton. I also have a Table on a Sheet in Excel that i would like to save as PDF.

When i click the CommandButton on the UserForm i would like the SaveAs screen to come up and have the Table (or Used Range in the Excel Sheet) as the selection to be Saved as .PDF format.

View 3 Replies View Related

VBA Sort Command Button & On Save

May 26, 2009

I have a sheet name "all" Sheet 15. What I want to do via VBA is sort range B4:I803 sort by Column G (ascending) then by Column H (ascending).

Have this sort activated by a command button or once the WB is saved then activate the sort prior to saving. The former is the preferred but if it's not to much trouble with coding then the former and latter solution would be great.

View 9 Replies View Related

Command Button To Save My Worksheet As A PDF

Jul 14, 2009

Not to sure if it can be done but i would like to have a button on my spread sheet that once pushed it automaticaly saves my worksheet as a PDF in a selected company folder in my documents.

I know if you go to file and save as PDF, then save in selected folder will work, just looking for a quicker way so my staff just needs to push one button on the worksheet and it does it all. (dummy proofing the form i guess)

View 9 Replies View Related

Excel 2007 :: Export To PDF Command Button Save As File Name?

Dec 17, 2012

Excel 2007 I have a button that will export the worksheet to pdf and save it as Acrobat requires. I have a network folder set up and it saves the file with the name that I have programed in the macro. I would like to have the file name set up to be what is in cell C3 then a space and the specific words.

For example, if C3 contains "123456" I want the file to be named "123456_Warranty Calculator"

I will end up using this in several worksheets which will have a different name as part of the file name (based on the worksheet name).

I would also like to have the last part of the file name be the worksheet name. ie, "Warranty Refund", "PDR Refune", etc.

I will have several users that will be using the workbook and possible saving at the same time and want each person to be able to find the one they saved instead of it being overwritten.

Code:

Excel 2007: I have a button that will export the worksheet to pdf and save it as Acrobat requires. I have a network folder set up and it saves the file with the name that I have programed in the macro. I would like to have the file name set up to be what is in cell C3 then a space and the specific words.

For example, if C3 contains "123456" I want the file to be named "123456_Warranty Calculator"

I will end up using this in several worksheets which will have a different name as part of the file name (based on the worksheet name).

I would also like to have the last part of the file name be the worksheet name. ie, "Warranty Refund", "PDR Refune", etc.

I will have several users that will be using the workbook and possible saving at the same time and want each person to be able to find the one they saved instead of it being overwritten.

View 2 Replies View Related

Excel 2010 :: Save Open Worksheet To File And Include Date Of Save?

Mar 11, 2014

am using Excel 2010 and having issues trying to save a worksheet to a specified file location with the save date....

I have tried several posts form this forum and elsewhere and can't seem to get the macro to do what I want.....

I want to save a 'worksheet' from an open workbook that I use for updating information to the same file path as the workbook with the date the file saved...

View 6 Replies View Related

Excel 2003 :: Unable To Allow Users To Make Changes To Workbook But Only Be Able To Do Save As Not Save

Dec 3, 2012

I have an expense report, which was originally done in Excel 2003. It still prompts users to open as read only however if they select no, they are not prompted for the password, and it has allowed them to save, so when the next person opens it, they have the previous person's report instead of the clean workbook. I have tried everything to put a password onto it. I know this is really basic stuff, but maybe I am missing a step? I want the end user to be able to make all the changes they want in read only mode and then do a save as, but if the select No when prompted "Open as Read-only?" they should have to put a password in.

View 4 Replies View Related

Excel Save As Should Default File Save Type To XLSX Using VBA

Aug 21, 2012

What I am trying to do is that I have an excel file with macros and it is a read-only file. In order for the user to save, I want them to only be able to save as a .xlsx file as it disables all macros. If for whatever reason, the user wants to save the file as another .xlsm file, they should be allowed but before they save, a "are you sure you want to save as .xlsm?" message should pop up.

All the options in the save as box should still be available in case they want to save in that particular format. Just that the .xlsx should be the default.

View 2 Replies View Related

Macro To Check If Saved Then Save Else Bring Up Save As Dialog

Sep 6, 2012

I'm trying to make a macro check if a file has been saved (ever). If so I want the macro to do a regular save (with already esatablished filename and location) before it proceeds with the rest of the macro. If the file hasnt been saved (if it runs from a new workbook) then I want it to pop up the save.as dialog, so that the user can choose the name and location of the file before the macro continues .

The macro itself is saved in personal.xlsx.

View 1 Replies View Related

Customize Look In/Save In (My Places) In Open/Save As Dialog Boxes

May 10, 2008

I would like to add some icons on the left side of excel open file pane to faciliate my work. Because i need to load some files under the same folder many times a day. Does anybody know how to do that? I've seen people has more icons on the pane before. The defaut setting has only 'History', 'My Documents', 'Favorites', 'Desktop' and ' My nutwork places' on it.

View 2 Replies View Related

Code, That Disables Save, Save As And Close Commands

Nov 2, 2009

Each of the worksheets in my model use A1 as a control cell for any errors and inconsistencies. My aim is to disable save and close commands in case A1 is not equal to 0 in any of the worksheets.

The code I currently use for that purpose is as follows.

View 2 Replies View Related

Save Workbook Using Variable For Save As And For A New Folder Name

Jul 31, 2009

I have figured out how to save the workbook using a variable to saveas but I would like to create a new folder to place the new workbook into. I have tried a few things a am not having any luck. I recorded a macro and the code it produced is as follows.

View 6 Replies View Related

Save As Macro :: Save File To Folder

Jan 17, 2010

I have a macro that copy one sheet of the Active workbook and sends it via email.

I need to add a code in this sheet so when one opens it from the email, with a command button to be able to save the file to specific, fixed folder on the local network with it’s original file name.

View 10 Replies View Related

Save Back Up Copy Online At Each Save

Mar 27, 2008

I have a sheet which I would like to back up online every time it is saved.

I have a sub, OnlineFile(), which I have used many times without any problems, which creates a .BAT file to use ftp to upload files onto our server. As arguments, it takes the local file path that you want to upload (or download to), the name of the file as you would like it stored, the online file path, and whether you want to upload the file onto the server, or download it off the server.

It should be very easy to combine the two: what I tried was:


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean)
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "" & "Rubbish.xls"
Call OnlineFile(ThisWorkbook.Path & "" & "Rubbish.xls", "Rubbish.xls", "wwwrootexcelfilesMasters", "Upload")
Kill ThisWorkbook.Path & "" & "Rubbish.xls"
End Sub

Every time I ran this, the file got uploaded correctly, but Excel had a series of problems. Often the code ran fine the first time it was run, but crashed the second time round.

After a fair bit of troubleshooting, I found that the problem came about when the file was trying to save itself - i.e. after the end of the sub. If you pause any macros from running, it still saved fine, but when the code ran, it found errors, froze or closed excel.

My thought at this point was that the code was fragmented or something. I made a new sheet, and retyped just the relevant bits of code (i.e. the BeforeSave sub, the OnlineFile sub and created the form called by OnlineFile). The problem persisted.

I've come up with a workaround for this now (which uses the same OnlineFile sub & form, and works fine), but it's driving me crazy - why does this cause excel to die? Particularly on the second time through? The code seems far too simple to cause such problems - is there a bug in Excel perhaps (I'm using Excel 2000 on Windows XP).

View 9 Replies View Related

Disable Save And Save As Feature In VBA

Sep 5, 2012

I am trying to disable the save and save as function using a macro, i know that this in its self is quite simple but i am making VBA create a new workbook and i want this (nameless) workbook to have the save feature disabled.

View 1 Replies View Related

Save Null Value But It Is Not Save In Same Rows

Oct 14, 2013

when i try to save data in other sheet. it is save but, if middle name is null in last record. then after i save other record the data is not save in same row.

i also want "sr.no" come automatically form data..

for.ex.

if in sheet2 last "sr.no" is "7" then it automatically display "sr.no" "8" in sheet1

View 8 Replies View Related

Save, Save As- And Reset Button

Jan 26, 2007

I have a spreadsheet with 32 worksheet, I want to write a macro to "save the work, save as.. in a specific location and with a specific name and then reseting all data in specific cells.

View 14 Replies View Related

Disable Manual Save But Let VBA Save?

Oct 5, 2011

I need my spreadsheet to require that the user save it by clicking a macro button, and not the Save or SaveAs options in the file menu. I have found out how to disable saving entirely:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
If SaveAsUI Then SaveAsUI = False
End Sub

But this of course prevents my macro button from saving too!

Is there any way to allow VBA code to save the spreadsheet while simultaneously preventing the user from saving through the menu?

View 2 Replies View Related

VBA (Save As) No Error But File Does Not Save

Oct 10, 2011

I have written the following simple macro to import some data into a worksheet and then prompt the user to save the file in Excel 2003 format (the system to which we will upload this data does not accept formats later than 2003). The template is in "*.xlsm" format.

The code executes without error, but when the user hits the "Save" button in the "Save As" dialog box, nothing happens. The "Save As" box closes, but no file is saved.

Code:
Private Sub cmdImportData_Click()
Dim sFName As String
'On Error Resume Next
PrepData
CopyData
FormatColumns
'prompt the user to save the file in "*.xls" format
sFName = Application.GetSaveAsFilename("upload", "Excel files (*.xls), *.xls")
End Sub

View 3 Replies View Related

- Disable Save As And Define The Save Name

Nov 16, 2006

I have a file that I have created that the users will use as a master template to create data that I need. Once they have finished, I want the file to define what the filename should be when they click save.

At the same time, I want to disable "Save As..." as some users will just use that and then will use a file name that another macro (that I will use) won't recognise.

View 7 Replies View Related

Overwrite The Save/save As Feature

Feb 26, 2007

i have a master workbook. it gets used daily as a template and saved as another file name. the file name is generated by 5 cells that each contain different data (date, street, town, state). is it possible when i hit the save or save as button/icon, for a file name to be automatically generated from the cells i have data in??

PostPosted: Wed Oct 15, 2003 5:12 pm Post subject: Re: change default saveas name for new file w/o saving
Okay, so you want to create a workbook via code, prompt the user for a SaveAs name, then save this workbook?

Sub CreateAndSave()
Dim wb As Workbook
Dim SaveFileName As Variant

Set wb = Workbooks.Add

ChDrive "C"
ChDir "C:VBA Code"

SaveFileName = Application.GetSaveAsFilename("It is a new file.xls", _
"Microsoft Excel Workbook (*.xls),*.xls")

On Error Resume Next
If SaveFileName False Then wb.SaveAs FileName:=SaveFileName........................

View 9 Replies View Related

Save Button Save The Workbook

Apr 5, 2007

I have a update/Save button on a spreadsheet. So when clicked it updates another sheet and saves the workbook.
how can i have it run the macro when they don't click the button and do
File -> Save.

View 9 Replies View Related

Disable Save & Save As Buttons

Dec 13, 2007

I use to send reports to my seniors on daily basis.
I want these reports to be with me and they can just open and check the reports, when I send them. If they try to save file through File-Save or File-Save As, they should not get these options at all in the File Menu.

View 9 Replies View Related

Macro To Save, Save As With Sequential Name

Feb 5, 2007

My spreadsheet has 32 worksheets, I've recorded a macro to do the job "save, save as with specific name", but what I want is, when save as, I wanted the file name increase in one number, and the date in a specific range "H8:J8" the date should be the next saturday.

here is part of the code.

Range("D11:J65").Select
Selection.ClearContents
Range("J44").Select
Sheets("NsFri").Select
ActiveWindow.SmallScroll Down:=-12
Range("A12:A21,D12:I21").Select

on this example I want the file saved as "PrA4W05.xls", being the next week "PrA4W06.xls", and so on.
and on "H8:J8" the next saturday.

View 9 Replies View Related

Choose Sheets That Save Or Don't Save

Jun 4, 2007

I have 120 sheets in my workbook and I only need 5 of them to save when there are changes, the other 115 are were data is pulled from. Is it possible to tell excel not to look at a sheet when it saves? I'm just after making it save faster.
This is going to be a workbook that " moves" a round a lot, so I want to the 115 sheets in the same workbook.

View 4 Replies View Related

Command Button - Create A Save Button In Sheet 1?

Mar 9, 2013

i want to create a save button in sheet 1, on clicking the same the data entered in the particluar cells of sheet 1 should get saved in sheet 2 in given format

View 1 Replies View Related

Macro To Save File - Save Name From Cell Containing Date Using Different Date Formatting

Aug 15, 2014

I am trying to create a macro to run from a form button, within a report, to save a file to a variable file path and name depending on the date value in cell B5.

The format of B5 looks like - 13/08/2014 16:39

The file path has folders for each year in format "yyyy" with each year having sub folders for each month in format "mm".

The file name is just the date only and is formatted "dd.mm.yy" e.g. 13.08.14

I have tried the code below in various permutations but always end up with an error - Method 'SaveAs' of object '_Workbook' failed.

[Code] ......

View 3 Replies View Related

Capture "Save As" Pathname And Save Another File

Nov 10, 2009

I have an excel workbook that uses a .bmp file [a picture]. The master excel file and the .bmp file are in the same directory on the network. The excel file is "Read-Only", so the user would open it, customize it and save it on their own computer or somewhere else on the network.

They are only allowed to save it under "Save As". Once the user saves it, they would then be able to use their customized copy for future updates etc. The problem is that the .bmp file is missing from this new directory.

Is there a way to automatically save a copy of the .bmp file under the Directory specified by the user, so it's always available when the Excel workbook is opened? Or is there a way to attach the .bmp file to the excel file, so they are always saved together?

View 6 Replies View Related

Save As Cell Name And Then Save As PDF

May 31, 2012

I have a VB set up that "Save As" the SHEET, with name based on the contents of a particular cell. - which works perfectly.

I then have another VB setup to save new file as a PDF.

The issue I'm coming across is that it is saving the PDF as the original excel workbook's name, not the new "Save As" name

example

Sample.xls has contents in Cell A1, when Macro activated it saves the active sheet as a new file with the contents of A1 as its name. Lets say Bob.xls

Sample.XLS also has another Macro, which when activated, saves as a PDF.

This macro is carried over to the newly created bob.xls

Issue is, it is saving bob.xls's PDF, as sample.pdf.

Anyway I can get it to save as bob.pdf without having to create a new macro every time?

View 4 Replies View Related

Disable Save / Save As

Aug 8, 2009

i tried all vba's here and on google to disable save / save as, but none of them work so i would like to know the other way , how to go with clearing the contents of cell, the moment someone clicks save / save as, with /without range by using beforesave event

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved