I have a question concerning Macros and the Disable/Enable prompt. My boss has a spreadsheet which has been used for years and he recently wanted to and did remove the macros from the spreadsheet (they were no longer necessary), but the disable/enable prompt still appears when the spreadsheet is opened. I replicated this in a test spreadsheet with a simple insert line macro and received the same results. Is there a way to remove the macros and the disable/enable prompt once they are removed? I know about setting the security to low to not see the prompt, but I would think that once the macros are deleted, the prompt should not appear any more.
VB: Private Sub Workbook_Open()Worksheets("Sheet1").ActivateRange("$B$1").SelectSheets("Sheet1").ScrollArea = "A1:z25"End Sub
Now I want to disable the above such that I am able to add an Apostrophe ( ' ) in front of every line of this Macro. Is there a shortcut for this or do I need to Manually add apostrophe in front of every line? And then after disabling if I need to re-enable it is there a shortcut to that too?
from 1 sheet i am opening several other worksheets and read in the bits i want. i am finding that on occasions the workbook_open on these sheets is causing great performance issues because of the calc mode set to automatic in the open routine of the individual sheets. i dont need it to be set to auto but the sheet owners perfer it to be set like this and i cant turn it off their sheets. is ther a way of opening a workbook from a macro and then override its workbook_open routine?
Set wb = Workbooks.Open(sSourceFolder & "" & "mySheet.xls", False, True)
i cant find any other switches that i could use to disable this.
How to disable a macro when the workbook opened is a copy ** the original, the only difference between the 2 files would be the date created, could it possible to use some VBA to check for this "Date Created", and if the date is different from the original, then the copy will not able to run the macro or some sheets will be hidden in the copied file?
Is there a way for a macro to be not active when trying to insert a row or a way to have the macro understand that it's just a row shift? I'm trying to have a time stamp that anyone changes the value in a column. The following code generates an error 1004: application or object defined error when I insert or delete a row.
I have a macro in a workbook template,that when the workbook is open it populates a cell with the date and time such as 111711.507. This becomes the contract number for this workbook.. They complete the form or workbook and save it. The next time they open the saved workbook the macro runs and changes the contract number to a new number. I want to disable the macro on the saved workbook from changing the number.
I am trying to code a macro call where in once the file is saved with the current week start date all the other macro's should be disabled. Since am having lot of data and report sheets which needs to be added and deleted in the run. It causes me problem when I try to open it again to view the results. For example I have a sheet named apple and another one applereport. I have made my code to delete apple since it is a data sheet. I want apple report to have all the other macros disabled once its been renamed to week start date for now it is 16 Mon 2007.
I have found a macro which disables all print features in excel. I have rwo other codes to print. When I put this macro, It also disables the print from the other macro. How can I use this code so that normal print features will be disabled but if someone takes the print from the macros, Print will be allowed. The code which disables the print is given below:
Private Sub Workbook_BeforePrint(Cancel As Boolean) If PrtOK Then Cancel = False Else MsgBox "Can't print from here!" Cancel = True End If End Sub
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.
Excel 2003 - VBA - How do you detect when a row has been deleted in VBA? Better yet, how do you detect when a row is about to be deleted? I also would like to know the row number. I do not see an event handler that will inform me of the "Delete" event.
I need to disable cut and drag only in a workbook. The idea is to avoid formula reference errors when unlocked cells are cut and pasted or dragged. I can find many macros online but none that do only these two things.
I am looking for a way that I can ensure that Zero Values are never shown, either when you open a new workbook or open a new window. Preferable, one which I can install for any user who needs this. (such as via Book.XLA I think) but AutoExec is fine as long as it is alwys loaded.
I've got an excel sheet from a guy at work who decided to lock the entire document down so I can't do anything with it. Virtually all the ribbon options are greyed out, there isn't anything locking it in the code, I've tried checking the save as "read-only" option and it's not there. How I can actually save this is editable? I've looked in windows explorer and it's not read-only in there either. I tried save-as and even tried making it an XLS instead of an XLSM and it still won't let me edit it
Need code or way of disabling the Right Click feature in Excel? I think you can change it in the computer settings but I only want to disable it for a particular workbook so I am hoping there is a VBA Code that will tell the user "Right Click Not Allowed, Please use Cut and Paste or Ctrl +V and Ctrl +C"
i know in VB6 i could disable the X in the corner so someone can't X out of my form, and i see that's not an option in VBA.
So how can i stop the form from terminating when the user clicks that? i want them to be forced to use one of my buttons to close out and finish.
i tried adding something simple like Exit Sub to the Userform_Terminate() sub, but nothing. i can make code run when they click that, but i can't stop it from closing. what to do?
also, the form is being called by macro that does alot of other stuff before and after the form, so just opening a new instance of the form won't help unless you can stop my other code from continueing until the form is actually done...
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
Does anyone know if there is anyway that we can command Excel to avoid accepting aNY KEYBOARD ENTRIES? what intend to do is restrict a certain region on a worksheet for Users not to be able to type anything but but there are commandbuttons on the header which use: Range("C65536").End(xlUp)(2, 1) = "Value for the last cell" code to get the input into the cell. The purpose is to make use of the cmdbuttons with mouse but the data notto be keyed in !!!