VBA Save As Dialogue Box?
Mar 20, 2013I am looking for a VB Code that will populate the Save As Dialogue Box, and it will have a file name prefilled, MacroEnabled.
For example (MyFile_123.xlsm)
I am looking for a VB Code that will populate the Save As Dialogue Box, and it will have a file name prefilled, MacroEnabled.
For example (MyFile_123.xlsm)
I would like a macro that will call up the SAVE AS dialogue box and populate it based on the contents of a cell. So far, I can save the file with a name taken from a cell but I'd like the user to be able to choose the location. I haven't been able to crack that yet.
View 9 Replies View RelatedUsing Excel 2007
I have made a macro in a xltm book that will open the "Save As" dialogue but I would like it to default to xls file type instead of the user having to select it in the drop down box.
In addition to this I would like it to name the file based on a returned "=NOW ()" function from a cell (sheet1!G13) that has been mdms date formated which returns an unique document number each time for our reference.
Here's the code so far which works fine for the "save as" dialogue box part
I have a vba procedure that concatenates the name I want to use as the file name and stores it in a variable named ""NuFileNm".
Is there a way to have the vba open the "Save As" dialogue box and enter the NuFileNm string into the "File Name" box ready for me to manually specify where I want to save it?
I have written a macro which opens a worksheet, performs various operations on it, and closes it again. The problem is that upon close, two separate dialogue boxes appear - one asking me if I want to save, the other asking me if I want to keep what I have copied in the clipboard.
Is there a way of answering these dialogue boxes (or suppressing them) from withint he macro, so I do not need to manually click on Yes or No each time the macro is run?
I am receiving a the 'Rename Sheet' dialogue box when I double left click on a tab? Normally, it will allow editing in the name of the tab, not a pop up.
View 9 Replies View RelatedI have a range of cells in a column where I put in properties of contents of another range of cells. If i put in the word "broken" in any of those cells (say B12) i like to have an input dialogue box popping up automatically. This is where the user 1 is supposed to give a brief description of the broken item.
The next user, 2, (which repairs the broken item) shall gain access to the written info made by the first user just by selecting cell B12. I like it to be a MSG Box that pops up automatically when the cell is selected. Just to clarify: The MSG box shall contain the words written in the dialogue box by user 1.
Does anybody have a clue how to achieve this?
I have this code, the problem is when I try to cancel the Open File dialogue it gives me an application defined error and I tried it a dozen ways and it keeps giving me the same thing.
View 3 Replies View RelatedI wish to use the custom option on autofilter several times. The problem is it closes every time I enter a new filter criteria. Is there a way to force it to stay open until I choose to close it? That way I don't have to use the pull down list to choose custom every time.
View 3 Replies View RelatedYes, another homework for you guys. I have found the code to open the "Find and Replace" dialogue box but is it possible to open it with "within:" Workbook instead of Sheet?
This is the code that open up the dialogue box ..
I am importing a text file that has a lot more than 256 columns. The data will be updated weekly with a different text file. I know how to get past the 256 column limit when importing a text file like this. This link explains the method I am using to import the text file. [url] Since I am importing onto several sheets I get the dialogue box asking me to choose a file to import from for every sheet when I use RefreshAll. The same file that is used by the first sheet will be used by the rest of the sheets. Each sheet just imports a different section of columns from the text file. I want to avoid choosing the same file 30 plus times (once for each sheet) when I click refresh all. Is there a code that would allow me to choose the file for the first sheet, and the other sheets would follow suite?
View 9 Replies View RelatedI have a sheet named "Fittings Summary" with an export button. I need some code that will copy range A1:G38 of the fitting summary sheet then open a dialogue box asking for the following "Please Enter Tag No" once a tag number is entered I would like a new sheet to be created in the same workbook named with the tag no entered previously then the copied cells pasted into it. I would like to keep the formatting of the cells but not the formulas within.
View 10 Replies View RelatedI have a tool file which contains Excel VBA codes. When I click button it asks to select a file. I want that anytime I click the button the dialogue box should open in the folder containg the tool.,
View 1 Replies View Relatedam 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...
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 RelatedWhat 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.
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.
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 RelatedI 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.
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.
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 RelatedI 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.
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).
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 Relatedwhen 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
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 RelatedI 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?
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
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.
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........................