Workbook To Display The Save As Dialog Box
Oct 21, 2008When a user tries to save a workbook I want the workbook to display the Save As dialog box. This will ensure that the template is not accidentally tempered with.
View 20 RepliesWhen a user tries to save a workbook I want the workbook to display the Save As dialog box. This will ensure that the template is not accidentally tempered with.
View 20 RepliesI'm not sure what I'm missing here, but I am trying to exit a spreadsheet using VBA code without saving changes.
The following code, to my mind, should work, but I keep getting a dialog asking if I want to save changes.
'* ensure workbook does not request user to save it...
ThisWorkbook.Saved = True
'* exit Excel...
Application.Quit
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 RelatedWe are currently utilizing a shared workbook (yes, I've read the inherent problems with this). This workbook needs to automatically save any changes and refresh itself every minute. We are seeking an answer to this goal, perhaps utilizing VBA code ?
We have researched the forums and attempted numerous snippets of VBA code and different settings already available in Excel (ver 2010) without success. And, we have tried using the Advanced Settings (Shared Workbook / Advanced Settings (5 mins)) .... however the display of newly added data is not updated on all viewing terminals unless we close the shared workbook on those viewing terminals and then re-open.
I'm building my first Add-In, which I'm using to gather all Sub's that I've created through my small VBA writting career. The thing is that when I write new code and some reason exit Excel and forget to save the XLA, obviously the code is lost. I've used:
View 4 Replies View Relatedwhat command can i use to bring up the save as dialog box ( where to name your saved file) if my file is already named?
View 2 Replies View RelatedHow can this be edited so when the savebox comes up when i hit save it saves the file but when i hit cancel it goes to error:
View 14 Replies View RelatedHow can i call the Save As dialog box from a macro, and pre-populate the filename field with a cell value from the workbook? I have tried this code
With Application.Dialogs(xlDialogFileSaveAs)
.Name = Sheets("Calcs").Range("b37").Value
.Show
End With
with the cell reference being what i want to show in the filename box. Each time i run it, i get an error message, "run time error 1004, application defind or object defined error"
How to use the xlDialogFormatMain dialog box in vba (Cell Format Dialog Box)?
I don't know the exact require parameters.
Application.Dialogs(xlDialogFormatMain).Show
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 RelatedI am modifying a corporate macro that is used in to create a standard technical letter. This standard file has 6 macros, that once used to create the letter, are never used again. I know, the first thing that jumps out is to create an add-in. I'd prefer not to got hat route at the moment for various reasons.
What I'm looking to do is after the letter is created, and the print macro is called and prints the letter, all macros are removed (already found help for this on this site), then check to see if the file has been saved, or still has the template name, and then either save or bring up the save as dialog box for the user to save the file with the appropriate name and folder.
I am running a macro on startup from a template that opens the File Save As dialog box to allow the user to select a folder and filename and save it before continuing.
I would like it to default to the Q: drive, it defaults to where the template was opened from.
I used
Application.Dialogs(xlDialogSaveAs).Show
to open the dialog, I tried using "Q:" as an argument but it doesn't seem to work.
if I try
Application.Dialogs(xlDialogOpen).Show "Q:"
I would like to have a dialog box "popup" if the value of two cells do NOT equal.
cell C11 has net sales values for the day, including cash, checks, and credit cards. After sub total of these values, I subtract any charges(voids) and get a total(c11). I enter a sales(c12), tax(c13), no tax(C14), misc. amounts(C15 & C16) ,reductions(c21) and put the total in Cell C22 with the formula =Sum(c12:c16)-c21). Because I do not want the formula overwritten, I protect the sheet including the amounts in cell c11 and c22. If they do "Not" match I would like a dialog box to appear so the error can be corrected.
my code brings up an empty dialog box.
The file I am trying to view is saved as follows: C: Test.gif
What I have done.Added a image control to a dialog box, called image1
Added the following event handler to image1:
x = c: test.gif
Image1.picture = loadpicture (X)Pressed F5 to test the code and brings up a dialog box with a blank image box.
Not called the userform in the main module (didn't seem much point considering the test failed)
My questions
where I am going wrong with this, the correct code?
Also in inputting the address of the file I could not use the C: format as this brought up an error. What is the correct format?
I have a command button code on a sheet that checks if all the cells in a table have been completed before saving the worksheet. If they're not all complete a userform message box pops up with a reminder then returns to the sheet without saving. I want to be able to call this from the 'BeforeClose' event as well however, even though it still does what it's supposed to do, after the userform message box has displayed and been unloaded then it still pops up the Save Dialog box.
I'm struggling to suppress the Save Dialog box and return to the sheet.
I have the below code to have the user select a pile path and save. what can I add to have the dialog box preselect the file type to macro enabled? the .xlsm extension is not doing it.
['save it under a new name
Dim fPth As Object
Set fPth = Application.FileDialog(msoFileDialogSaveAs)
With fPth
.InitialFileName = Worksheets("Project Setup").Range("f19").Text & "_ROM Estimate.xlsm"
.Title = "Save your File:"
.InitialView = msoFileDialogViewList
.Show
End With]
I want to close a tab delimited Txt file that is open in Excel, thru' a macro, without the save changes dialog box appearing.
View 2 Replies View RelatedApplication.Dialogs(xlDialogSaveAs).Show
I am using above code and I want to find out whether the user pressed the save button or the cancel button in order to take the next action.
I have a spreadsheet that automatically opens a dialog box when the workbook is opened. This is a little disclaimer intended for other users of the spreadsheet, which if they click ok it simply closes the dialog sheet, but if they click cancel I want it to kick them out of the Workbook without asking them to save changes. I only want it to close that specific workbook incase they have others open that they haven't saved, etc.
The dialog box is opened as follows:
Private Sub Workbook_Open()
DialogSheets("Splash Screen").Show
End Sub
The code I have tried for the closing of the workbook is done by assigning the following macro to the cancel button (note, all but one of the sheets in my workbook is hidden and protected, including the dialog sheet):
Sub Splash_Close()
'
ThisWorkbook.Close SaveChanges:=False
'
'Also tried ActiveWorkbook.Close SaveChanges:=False
'Application.Quit (This closes all excel documents)
'
End Sub
I know there is something I am missing, keeping in mind I am quite experienced with excel, but relatively new to macros and VB programming.
Just a bit extra on this problem. I am creating the file as a template *.xlt, and the error I get when trying to run the example macro I gave at the start is a 1004 error Method close of object _workbook failed.
Also, in an ineresting (baffling for me at the moment) twist is that once you hit end on the error and it just goes to the first page of your spreadsheet, you can then go to ToolsMacros and run the macro from there, and it closes the workbook exactly the way I want it to!
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 RelatedI have a summary file (I'll call it File A) from which a macro is run. It opens other files, finds a "total line" then copies it into File A. Then it closes that file, opens another, and repeats the process. The macro works fine for most of the files it opens and closes, but on some of them, upon the close command, a dialog box pops up asking "Do you want to save the changes you made to "File B.xls"?
I'm not sure why this comes up as there were no changes made. Cells were only copied and pasted into another file. Is there a way to stop this annoying box from popping up? It slows down the macro by waiting for human input. here is my
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 currently have the following code that copies a range opens notepad pastes the range opens save dialog and types the file name. The problem I have is with overwriting the existing file.
Range("A1:A202").Select
Selection.Copy
Shell "notepad.exe", vbNormalFocus
SendKeys "^V"
SendKeys "^s"
SendKeys "Total_IEDs_Hour_Of_Day_2009.xml"
SendKeys "{TAB}"
SendKeys "a"
SendKeys "{ENTER}"
Everything works fine to this point. Then it opens the do you want to overwrite dialog and I cant get it to hit yes.
I'm trying to get the below code to save the workbook before the macro continues. I would like for the Save As browser window to be displayed so that the user can select a location to save in.
It would be great if it could maintains the existing name and file type.
The code I attempted below will save the file I just don't know where to!!
Code:
Sub Clear_Quarter_Call()
'Activates password message box
If UCase(InputBox("Enter Password 'This Action Cannot Be Undone' ")) "2222" Then Exit Sub
[Code]....
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.
I have been trying to edit a code which previously saved a copy in a new workbook to a specific folder/path. (Additionally it copies and clears some figures, but this is working as it should.)
However I would like the copy to be saved at the same location as the original workbook, regardless of the path the original workbook is saved.
I.e if I need to move the workbook containing the code to a new folder/location, when using the macro, the new copy should be stored in the same folder/location as the original one.
For now it is only saving the copy into "My Documents"
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 16-02-2009 by ceng
'
Sheets("Bunker ROB").Select
Sheets("Bunker ROB").Copy
ActiveWorkbook.SaveAs Filename:= _
ActiveWorkbook.Path & Range("D3"), _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
[Code] ........
I want the Userform1 that has a text message to be displayed for 5 seconds before it saves to D:DATAsimon to input.xls
I have placed the code below in the module and in the MacroPreviewList, I insert the Call Function as "Call UserFormSimon_Activate" before it continues with saving the workbook. It doesn't work. Did I use the Call wrongly?
Call UserFormSimon_Activate
ChDir "D:DATA"
ActiveWorkbook.SaveAs Filename:= _
"D:DATAsimon_to_input.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = False
ActiveWorkbook.Close
After I use a script, as follows (data must be present in C1) to continue, how do I display a message box "SUCCESS" after an successful save.
Sub SaveAsCell()
Dim strName As String, SaveAsFileName As String
strName = Sheet1. Range("C1")
If strName <> "" Then
If Right(strName, 4) <> ".xls" Then strName = strName & ".xls"
SaveAsFileName = Application.GetSaveAsFilename(InitialFileName:=strName, FileFilter:="(*.xls), *.xls") ..............
I'm trying to find a way to save a single sheet of an excel workbook and in the same process delete all vba code and shapes from the new single sheet workbook. I was looking around and found this code which does save only the single sheet to a new one sheet workbook but doesn't delete the vba and shape that I have used to assign macros to in the original.
Code:
Sub SaveSheetAsNewBook()
Dim wb As Workbook
Dim InitFileName As String
Dim fileSaveName As String
Dim wshape As Shape
InitFileName = ThisWorkbook.Path & Format(Date, "mm.dd.yy")
[code]....