Disable Save Except When Pressing Button Or Using Modifier?
Apr 15, 2014
I have a button in a template file, that when clicked, saves the file as a new file with file name based on data in certain cells.
I want to disable the ability to save the file with the Save icon or Ctrl-S, but the button still needs to be able to save it (the button is technically doing a Save As, so no problem there). But, I, as the administrator of the template, need to somehow be able to save updates to the template file. Can this be accomplished by coding Save to work when used with a secret key combination that only I know (I can put it in password-protected VB code)?
Then, as if that's not tricky enough, the trickier part is that once the file is saved as the new file (no longer the template) - re-enable the Save button and Ctrl-S so the user can then save it as many times as they want.
Is it possible to launch Excel at a specified time without someone pressing a button?
I'm working on a network which has disabled Scheduled Tasks. The purpose of this request is to launch Excel in the early hours of the day so that a macro would run and update the data from a data source. The macro works brilliantly, but I without anyone in the office at 2am to open Excel, I need to find a way to launch it automatically.
Also, I don't have permissions to install programs or add-ins from the Internet. It doesn't leave me with many options, but I'm just wondering if there's a trick that has so far eluded me.
The name of the data entry sheet is 'Enter Data Here', and my employees will be filling in information in columns A to U.
I want to be able to accomplish 2 things.
1) When an employee opens the file, he/she is not able to edit any non-blank cells in columns A to U. 2) Employee is able to add data to a new row in columns A to U, and is able to edit this until they press 'SAVE'
I have developed a Userform button in Excel 2010 using the developer icons, which when clicked on with my mouse it runs my super dooper macro. It works great!
But one thing I want to have happen is to have the choice of using the Enter key to start the macro or use the left mouse button
For example, I place data in (say) cell A1 and the userform button is in cell A2. When I place the data in A1 and press the Enter key, the cursor moves down to A2, but doesn't highlight the user button. When I press the Enter key again, the cursor moves to cell A3.
What I want is when I fill in the data in A1 and press the Enter key, the cursor moves to cell A2 and selects the button, so that when I press the Enter key again, it activates the macro.
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.
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 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.
here is the formula I am using. =IF(A5 < =Schedule!$K$9,100%,0%) We only track complete and not complete....so my formula above just comes out to 100% or 0%. What I am wandering is if I can add a modifier so that it can be adjusted w/o just over writing the formula. Ok so my vision is, the formula above is in cell B5.....next to it in cell C5 I would like a modifier so that if that amount should really be 85%. I can type 85% in C5 and it will change B5 to 85%. So I guess the formula would be more like =IF((A5 < =Schedule!$K$9,100%,0%),or = C5))
Is there a way to disable 'Save as PDF or XPS' with the macro? I have tried disabling 'Save as' with the below VBA code but it does not disable 'Save as PDF or XPS'.
VB: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If SaveAsUI Then MsgBox "Save As is disabled", vbInformation Cancel = True End If End Sub
Also I have a macro which saves the excel report in a PDF format with 'Save as PDF or XPS' utility. I would like to enable 'Save as PDF or XPS' when this macro is started and again disable 'Save as PDF or XPS' when this macro stops.
I want to disable the X button on the top right hand corner in excel, but still allow the user with the option of closing the workbook via File and then scrolling down to EXIT. (Not close). I have disabled most of the functions in the Menu bar Close being one of them.
So only Exit is now enabled. When I click on the X it give me the following message as shown below advising me to go to the File menu to Exit, this bit I am happy with. However this is were my problem begins, when I go to File and Exit I get the same message as below and can not exit the application.
Private Sub Workbook_BeforeClose(Cancel As Boolean) Cancel = True MsgBox "Please select EXIT from the File Menu.", vbCritical, "Cannot Close" End Sub
I currently have a macro which does data mining and saves the workbook in the end. I intend to disable to the save function of the workbook and force the user to use the macro everytime the workbook needs to be saved. this is what i have so far but it does not seem to work. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim NoSave NoSave = MsgBox("Changes have to be submitted before the workbook can be saved, Proceed and submit ?", vbYesNo, "Continue?")
The code below is supposed to disable the appropriate command buttons when it's associated cell values are 0.
Private Sub Worksheet_Activate() If Range("C17").Value = 0 Then ActiveSheet.CommandButton7.Enabled = False ActiveSheet.CommandButton4.Enabled = False Else ActiveSheet.CommandButton7.Enabled = True ActiveSheet.CommandButton4.Enabled = True End If
Not working ..... no buttons are disabled even with their cells are zero. Did I forget something?
I would like some help on disabling the Esc key in a macro and to disable the Cancel button and X on message and input boxes.
My macro is to insert rows in a protected worksheet and another to run a spellcheck, if my users hit any of the above keys during the macro my worksheet is left unprotected and formulas could be deleted in error. I have pasted a copy of my code below,
Sub InsertRowAboveCopyFormulas() ActiveSheet.Unprotect ("password") Dim Rng, n As Long, k As Long Application.ScreenUpdating = False Rng = InputBox("Enter number of rows required.") If Rng = "" Then Exit Sub On Error Resume Next ActiveCell.EntireRow.Select Selection.Resize(rowsize:=Rng).Rows(1).EntireRow. _ Resize(rowsize:=Rng).Insert Shift:=xlUp Selection.Offset(Rng).AutoFill Selection.Resize( _ rowsize:=Rng + 1), xlFill Selection.Resize(Rng).EntireRow. _ SpecialCells(xlConstants).ClearContents ActiveSheet.Protect ("password") End Sub
I'm sure there is a way to disable the 'X' (quit) button in the top right-hand corner of the EXcel application (not the 'X' for individual workbooks), or the hook the quit event so that I can run code that shut down the application cleanly? I'm sure a Windows API call is involved but do not know enough about that side of programming to know for sure.
I have buttons on each of my sheets, when one is clicked code is called in my module ("modAPI"), and from that code I wish to disable and enable certain buttons, and/or change the caption of those buttons. However when I try to do:
With ws btnRefresh.Enabled = False End With
I get Error 424, Object Required. I've tried recording a macro of what I wish to do, and it gives me ActiveSheet.Shapes("btnRefresh").Select, but this doesn't give me the option to enabled/disable or change the caption of the button.
I know the disabling of 'Save As' has been covered alot. I have successfully disabled both Save and Save As at the file level by the following:
Making file Read Only (which disables Save option)
Inserting the following VBA to make the Save As disabled.
The remaining problem I have is disabling the Save As prompting at the program exit level.
For example, if I have a read only file with Save As disabled and I choose the workbook (file) level close window (X) button, I am prompted to save the file but am not allowed to. This is the behavior I am looking for.
HOWEVER, if I choose to exit the file by selecting the program (Excel) level close (X) button, I am prompted to save a copy of the file and it allows me to do it.
I do not want my ~180 users to have any option to save the file once it is uploaded to a centralized server location. It is a large file and I do not need multiple versions floating around.
Is it also possible to disable the 'Save As' on close at the Program level??
I have two option buttons on a user form, one for a temperature of <250 & one for a temperature >250. I want the option button >250 to be greyed out or have it so that you cannot choose it & option button <250 selected if a certain criteria in a list box is selected. The list box is called Valve_Model & the criteria i want it to work on is if the valve model HPBV Soft is selected & HPBV Soft AC.