Saveas Dialog: Closes The Created Spreadsheet Without Saving It
Oct 20, 2006
I have a workbook that has twenty data sheets. The user presses a button that copies they're specified sheets to a new workbook and prompts them with the SaveAs Dialog. How do I code it so that if they press the CANCEL button on the SaveAs Dialog it closes the created spreadsheet without saving it?
View 6 Replies
ADVERTISEMENT
Oct 31, 2009
I'm hoping someone can stop me going crazy with what should be something very simple. To make things easier at the end of my code, all I'd like to do is bring up the SaveAs dialog box and have it default to a specific directory so that the user doesn't have to click through the mountain of various files and folders we have.
View 6 Replies
View Related
Jun 20, 2007
This code appears to do opposite of what I intended i.e., when I click 'Yes' button it closes the file without saving; and when I click 'No' button it closes the file with saving?
Private Sub btnExitNewPipes_Click()
If MsgBox("Save the Data?", vbYesNo + vbQuestion, "File Save") = vbYes _
Then ActiveWorkbook.Close SaveChanges = True
ActiveWorkbook.Close SaveChanges = False
End Sub
View 7 Replies
View Related
Dec 13, 2006
I already have a macro that on opening the workbook checks to see if the workbook has been renamed outside excel in windows and if so closes the workbook. I need a macro to intercept the save as command and prevent the user from saving the workbook as another name. I would however still like the user to be able to save. I would also like them to be able to save the workbook in another directory but only with the same workbook name.
View 4 Replies
View Related
Jul 17, 2012
I'm working on a Tool, where every change should be saved in a new Version. So if the user changes any number, he should click my selfcreated save-button, which takes todays date in the filename (no problem so far).
I tried to disable the "normal" save-button with:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
MsgBox ("saving cancelled!")
End Sub
Unfortunately this code won't allow my own button to save too. Is there any other way? Maybe sth like if "normal" saving is used, then automatically activate a makro (which is also on my button) instead of just saving?
View 2 Replies
View Related
Dec 14, 2006
I want to be able to have the Save As dialog box come up, but with a File Name already chosen, so that the user can save it as this File Name in any location he/she wishes. I can get the Save As dialog box coming up with my code, but I don't know how to automatically enter the File Name
View 4 Replies
View Related
Jul 1, 2014
I have an issue with saving the file at the desired location below is the code i have currently used . I have given the destination as "D:New folder". The new file does get saved at location "D:" but not inside the "D:New folder", instead names the file as "New folder".
View 3 Replies
View Related
Jun 18, 2009
I am trying to have the user hit a button and save the workbook in a newly created directory. Currently it creates the new workbook and the new directory with the correct names, however the workbook is not in the newly created directory.
View 5 Replies
View Related
Aug 16, 2006
I have code that creates a row of controls on an MSForms.Userform at runtime.
I would like the user to be able to save these controls so that they are available the next time he opens the form. The user would be able to add or delete a row of controls and save them AND the values that he has set. This allows great flexibility for each session using the form.
The values aren't a real problem - I've been using the SaveSettings function for the design time controls values. The runtime controls are combobox, textbox, listbox, checkbox.
I don't want to design-time build the controls and just toggle the visible property (not a good solution for my app).
View 3 Replies
View Related
May 14, 2007
I am using Excel 2003 and have created a spreadsheet in which one column has text. I have created a second spreadsheet and I am trying to use vlookup to bring in the text from spreadsheet number 1 to spreadsheet number 2. Some but not all of the text comes over-it just stops at certain point. Has anyone else experienced this and is there a solution?
View 9 Replies
View Related
May 2, 2007
I have created a non-subjective job evaluation spreadsheet, which takes data obtained from a work daily of an individual and is implemented in my spreadsheet. The columns of areas to be evaluated will average each individuals performance by averaging the individual to the rest of his shifts performance and a point system has been established depending on their work level. The situation I'm running into is I'm using the formula below to establish my point system. In an effort to be fair in every way possible, should a particular column end up with all zeros "0" this would then become the average, which should provide the individuals in this group with three "3" points. My forumula as it is set up will now only give one "1" point, when it should be three. The point system works great other than this one particular problem, when everyone has a zero. I'd sure appreciate anyone's suggestion how I might be able to add one more IF statement to this existing formula. Note: I29 is the cell for this particular column that represents the average of the column with data in it. I28 is 10% above average, I27 is 20% above average, I30 is 10% below average and I31 is 20% below average.
point system is 1 point for 20% below average, 2 points for 10% below average, 3 points for average, 4 points for 10% above average and 5 points for 20% above average.
=IF(ISTEXT(I3),0,IF(I3="",0,IF(I3<=$I$31,1,IF(I3<=$I$30,2,IF(I3<=$I$29,3,IF(I3<$I$28,3,IF(I3>=$I$27, 5,IF(I3<$I$27,4))))))))
View 10 Replies
View Related
Oct 22, 2008
I have a macro that opens up a file, copies info from the file then closes it and the macro continues. I don't want the user to have to click on any 'do you want to save changes' prompts.
View 5 Replies
View Related
Jul 19, 2009
I have created a macro which copies the content of one of the sheets of a workbook, on to a new workbook and then saves the new workbook as 'temp.xls' on the desktop.
View 5 Replies
View Related
May 2, 2014
I need to restrict printing & saving functionality on a excel spreadsheet that is shared with a large group of people.
I was also hoping for the restricting save part, to do an AD lookup to see if they are a member of group "X", if they are then allow the save, if they are not then deny the save.
View 1 Replies
View Related
Sep 24, 2013
I have a spreadsheet that contains product images in cells in column A. In the matching cell in column B there are product codes. I would like to be able to "batch/bulk" save these images and label them by the corresponding product.
Is this possible. Or is there a different way around this issue.
View 9 Replies
View Related
Apr 22, 2007
how do i use worksheetfunction save to save a particular sheet everyday at a certain time e.g. 5.30pm to a particular folder.
Also the name of the file will change with the day.. e.g. 22_Apr_07.xls for today.
And to also refresh the page / recalc before saving at 5.30pm...
View 6 Replies
View Related
Nov 16, 2011
I've got a list of files in column A (Starting A1), this is complete with filepaths Now I need a macro to open the workbook in A1 then when i close that workbook it then opens the workbook in A2
basically to save me opening them manually each time..
View 2 Replies
View Related
Aug 5, 2014
I need to create a variable that will be TRUE/FALSE based upon whether the user has made changes to a certain range without running a specific macro. Basically, if they change cells in a certain range, the 'Update' macro must be run. I want this variable to be False if the cells have changed without running 'Update' and then when 'Update' runs, it sets the variable back to True.
I've been able to make this work with a Public variable, but if the user closes the workbook, the variable resets to False. Is there a way to create a variable that will be remember even if the workbook closes?
View 2 Replies
View Related
Feb 22, 2010
I'm looking for a way to execute some code, when the user closes the workbook/excel.
So far, I've found this
View 3 Replies
View Related
Nov 21, 2008
I have a simple list of about 4 hundred addresses. Like most US Address, they all start with a street number, for example 1234 Main St. What I would like to do is have a cell where I can type some of the address, maybe just the number itself, and another cell with search the array for all possible matches. So if I type is my criteria cell 1234, I will ahve a result cell that displays 1234 Main St. And if there are multiple address witht he nubmers 1234, such as 1234 Main St. and 1234 Poplar Grove Rd. and 1234 Bennington Ln then I would like for my result cell(s) to display all possible matches. Does anyone know an easy(ish) way I can do this with formulas?
View 2 Replies
View Related
Jan 14, 2008
This is my first time posting to the site so I will start with a simple question. I have an email macro that will send the workbook to a specific recipient. What I want it to be able to do is close excel after the macro is ran and the email is sent. If anyone would be kind enought to supply me with a code that will work .....
View 9 Replies
View Related
Jul 22, 2006
I have a central workbook that relies on data from other workbooks during the various calculations. I am trying to write some code so that when a user closes the central workbook, all of the other workbooks close as well. I have added my code to the thisWorkbook code, but this does not seem to work. Here is an example of the code. The object is to look for a workbook called Import_Sheet5 and to close it if it is open.
Private Sub Workbook_Close()
Dim Wb As Workbook
Dim sSought As String
sSought = UCase(wbName)
For Each Wb In Application.Workbooks
If wbName = Import_Sheet5 And InStr(Wb. Name, wbName) Then
Wb.Activate
Wb.Close SaveChanges:=False
End If
Next
End Sub
View 7 Replies
View Related
Oct 9, 2012
I have 1 main userform and I need to open another userform using a command button from within that 1st form. The 2nd userform appear right in front of the 1st userform. When the 2nd userform is closed either via VBA or clicking on X, it closes both forms.
why this happens and how I can make only the 2nd form close when it is finished with?
View 3 Replies
View Related
Jan 30, 2007
I do not want ThisWorkBook to close prematurely whenever the specified Activeworkbook is closed without saving because there are other tasks to complete. The Workbook_BeforeClose dun seem to fix it for my case below.
Here’s my situation. I want to copy data from a range of a particular protected sheet in 5 (password-protected) workbooks of a similar format, to 5 worksheets(unprotected) in ThisWorkBook, which is the Master Workbook. The password of the protected sheet is common to the 5 workbooks. The passwords of the 5 workbooks are contained in a sheet in ThisWorkbook. After copying the data from Workbook1 ( 1 of 5), ThisWorkbook are prompted for closure, when Workbook1 is closed without saving. Responding to the prompt to save or not to save, forces ThisWorkbook or MasterWorkbook to break the For-Next loop. By setting Cancel = True in Workbook_BeforeClose, I can stop Thisworkbook from closure, but I will still break the For-Next loop. I have considered the method of copying data from a closed workbook, but I dun think VBA allows copying or referencing a closed workbook which is password protected at workbook and worksheet level.
Here’s my coding :
Sub UpdateMaster()
Dim MasterWB As Workbook
Dim TempWB As Workbook
Dim Source As String
Set MyWB = ThisWorkbook
For i = 1 to 5
Set TempWB = Workbooks.Open (Filename:=WB(i), Password:=password(i) )
TempWB.Sheets("ProtectedSheet").Unprotect Password:="SheetPasswd"
MyWB.Sheets(i).Range(XXX).Value = TempWB.Sheets("ProtectedSheet").Range(YYY)
TempWB.Close False ‘dun want to respond toclose ThisWorkbook else it breaks for-next loop
Next i
Application.Quit.
End Sub
View 9 Replies
View Related
Aug 6, 2009
I can delete Sheet5 using this macro. I would like to put this in the workbook so that when I close the workbook it will be activated if Sheet5 exists. If Sheet5 does not exist nothing will happen.
Sub DeleteSheet5 ()
Application.DisplayAlerts = False
Sheets("Sheet5").Delete
Application.DisplayAlerts = True
End Sub
how to mark the post as solved other than go advanced and selecting solved from the drop down menu can you tell me how?
View 9 Replies
View Related
Jul 19, 2006
Userform Loading with database turns to close all Excelworkbooks completely
Database created in Excel worksheets to load and show in various different objects on userform. At present this project file size is approximately 2.5 mb and more to go as it is not yet complete. Now you can imagine how much big this project can be.
It uses various different types of objects such as listboxes with many columns, combo-boxes, textbox, checkbox and many. Every objects has its own style to display data on userform which is set in its properties itself.
Before loading userform to display, program creates database from manual entry (which is made by user on their working sheets) to database entry sheets (which is made to make compatible to show on userform). Upon loading, it also loads/populate all datas required in their objects to display.
All works perfect when I am in editing mode. It doesn't matter how big the database can be and works as required. This Project is now Password Protected and distributed among all staffs in our company to work with.
Error Occurs, when I tested in non-editing mode. The moment I triggered the macro to load the program, it takes some few times and pops-up with Excel Recover error message box asking whether to send Error Report and to whether recover & start Excel application again??
I don't know what is wrong. Sometimes it also run successfully when in non-editing mode even there is no changes in program codes.??
Sometimes I feel there can be a virtual memory issue, but my Pc is more than enough with 1GB ram. I hv also increased virtual memory limits and tested but all vain attempt...
View 9 Replies
View Related
Jan 30, 2003
I have a spreadsheet that imports data, manipulates it then deletes 2 of the sheets then saves the file under a different name to the network. Is there any way to save this new worksheet without it storing the macros - so when the user open it, only the data is there and they get no prompt to enable macros?
View 6 Replies
View Related
Apr 9, 2009
Is there a way too get the SaveAs box come up with a marco? When you go too file and save, a box comes up and lets you choose where and what you save. I would like too have it come up with a command button if its possible.
View 3 Replies
View Related
Dec 31, 2007
Sub CrearCSV()
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("Prueba").Activate
ActiveSheet.SaveAs Filename:= _
ThisWorkbook.Path & "Prueba.csv", _
FileFormat:=xlCSVWindows, CreateBackup:=False
Set CSVfile = ActiveWorkbook
CSVfile.Close savechanges:=1
End Sub
Sheet "Prueba" is Hidden
Other Sheet is visible
Why SaveAs stores only the visible Sheet?
How does stored hidden Sheets with WorkSheet.SaveAs?
View 9 Replies
View Related
Apr 29, 2009
I'm running a macro in a template and trying to save the results to a different folder.
I want the file name to be blank in the Saveas Text box of the UI also. Unfortunatley my code is bugging out & I can't work out why.
ActiveWorkbook.SaveAs Filename:="C:", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
The save to path does change so I want to be able to change the save location.
View 9 Replies
View Related