Cancelling Events Disabled?
Jul 14, 2007
The boolean Cancel suddenly stopped working for me in all workbook and worksheet events. Consider a simple example:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
does not cancel right click, like it has before. Same with BeforeDoubleClick. I can only assume it is some kind of a setting or similar, as there is absolutely no change in the code.
View 4 Replies
ADVERTISEMENT
Oct 20, 2012
I have a UserForm with a Text Box, I populate that Text Box with a number (say 5) and then the following code runs:
Code:
Private Sub tbOverrideMokWh_Change()
Application.EnableEvents = False: Application.ScreenUpdating = False
With tbOverrideMokWh
[Code]....
After the Sub is run 1 time, it runs again. Why? I've disabled Events?
View 6 Replies
View Related
May 16, 2007
I have some code which is calling a macro, in this macro I want it to cancel the code if a cell on my spreadsheet is zero.
Its basically an error check if a range of cells are all used up.
Basically i've tried a few different codes to try and cancel the click if the cell is zero but they dont work.
View 9 Replies
View Related
Apr 23, 2014
I have a macro which:
Opens up a workbook
Presses refresh all
Waits 10 seconds
Selects 1 cell
Saves the workbook
Closes the workbook
At some point in this process a dialog box comes up saying 'this action will cancel a pending refresh command' or words like that. How I can bypass this? It interrupts the macro.
View 14 Replies
View Related
Jul 20, 2009
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 Related
Sep 29, 2009
I have the following Input Boxes. If cancel is pressed on any box then I want the process stopped. eg if I enter an answer on sya questions one or two then click Cancel on question 3 I want the process stopped.
View 2 Replies
View Related
Feb 9, 2012
How to correct the code below so that OnTime is cancelled when the workbook is closed?
Error on bold line is Run-time error '1004': Method 'On Time' of object'_Application' failed
Code:
Public RollTime As Date, CalculateTime As Date, RefreshTradesTime As Date
Sub CancelOnTimeProcess()
SetTimesForRoll
With Application
.OnTime RollTime, "RollMacro", , False
.OnTime CalculateTime, "AutoCalculation", , False
.OnTime RefreshTradesTime, "UpdateLinks", , False
[Code] .......
CancelOnTimeProcess is being called when the user closes the workbook:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
CancelOnTimeProcess
End Sub
View 2 Replies
View Related
Dec 5, 2013
I wonder how I am supposed to do to stop excel from returning the error message "Runtime error 13" when pressing the cancel button on a Inputbox.
View 3 Replies
View Related
Dec 13, 2012
I am aware that I can use single changing events in worksheet change events. For instance, if column 1, or A is changed, do something. This is only a single If statement, i.e. either the condition is true, or not. What I am not sure is if I can use two changing events, i.e. two conditions. For e.g. I would like if Column A value is X and Column B is "Active", action it, but only if two conditions are true.
For.e,g. The below syntax does not work. If it is only column A, it does work, but I want both A and B to be true, then copy and paste the target does not anything.
VB:
If Target.Column = 1 Then
If Target.Column = 2 Then
If Not Intersect(Target, Range("A2:A" & Rows.Count)) Is Nothing Then
If Not Intersect(Target, Range("B2:B" & Rows.Count)) Is Nothing Then
If Target.Value = "X" And Target.Value = "Active" Then
View 4 Replies
View Related
Jan 21, 2010
Just discovered the drawing tools on my quick access tool bar are disabled. All were enabled and working fine just yesterday. I'm running 07 on xp. I've shut down and rebooted, no change. Need to know how this could have happened but mostly, how to enable.
View 9 Replies
View Related
Jan 21, 2013
Is there a way to save a document as a PDF but with printing disabled?
View 3 Replies
View Related
Jun 22, 2007
How can I write a "warning" in the form of a message box that will appear if the user does not enable macros?
Also, can I have one of the buttons on this message box turn on macros?
View 9 Replies
View Related
Jul 19, 2007
I am creating a workbook and need the user to stay on a single page of the workbook until certain circumstances have been met, specifically, a macro has been activated, thus confirming that certain data is now in place. Is there a code of function that I can introduce into the workbook so that clicking on the other tabs of the other sheets will not allow the user to leave the page they are on until that circumstance is met?
View 9 Replies
View Related
Sep 25, 2009
I have this code that I've sourced from the internet, i have used to disable red "X" on the top right,
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = Not bClose
If Cancel = True Then MsgBox "Please Save your data and select File - Close from the main menu"
End Sub
but when I select File and then close .... it runs the same macro? eh? i want x's disabled not the file close ....
View 9 Replies
View Related
Feb 23, 2010
I have a worksheet that all of the icons that start a macro disappeared. The workbook will not let me insert a pic, or clipart. Nothing is locked.
View 9 Replies
View Related
Nov 6, 2006
I have noticed that the submenus for the following main menu items are disabled
Edit Insert Format Data
The submenus for the other main menu items are fine.
I have not run any macros that alter the menus.
I have tried Tools>Customise Reset Menu and Toolbar usage. I then exit the Excel session, but the problem still remains,
View 3 Replies
View Related
Mar 7, 2013
I have a worksheet with several option buttons and until yesterday, I had no problem selecting them. But today, every time, I select a radio button, an error shows up stating "Cannot run Macro "Option Button_click. Macro is not available in this workbook or is disabled". When the user selects a radio button, text appears in Col B depending on what button was selected (using VLOOKUP). That stuff is still working fine. It's just as soon as I click a radio button, the error shows up.
Based on the radio button selected, user can add in information to the columns adjacent to it, and then click a button to store that information in some rows below. The code for that button is stored in the sheet module. I have tried enabling macros and disabling macros and no change has appeared. What I have noticed though is that yesterday, when i opened the workbook, a yellow bar appeared asking if I wanted to "Enable Content". Today, that bar didn't appear.
View 1 Replies
View Related
Apr 28, 2008
I was playing around with Macros on an excel file. I created a few and ran them. In the end, I didn't like the way they ran, so I deleted them all. However since I ran them in the excel file, every time I open the file it gives me a warning saying
"Macros have been disabled."
Is there any way to remove the possible Macros ties/links from my file? I know I can disable the warning, but if I just want to remove the Macros ties to my file.
View 10 Replies
View Related
Apr 9, 2009
I'm using excel 2003 and received a file that has the properties (file/Properties) menu option grayed out. I need to access the properties menu to identify file information.
View 6 Replies
View Related
Aug 2, 2014
continued from: [URL]
Option Explicit forces explicit declaration of all variables in the code. That is why i had to declare ws as worksheet using the Dim statement before using it in the code. It is recommended to have it - however for this code it wouldn't have mattered.
I'm not sure I exactly follow what you imply here. But yes, you can hide all the sheets at first and then "unhide" at the start of the macro. Let's say you have a "Start" sheet.. then:
[Code] .....
The workbook is used by other people too. I cannot just tell them to hide the sheets, it defeats the purpose. What I want is, when macro is disabled, they will only see the START sheet, otherwise, all sheets will be visible. To add to this, a new sheet is added everyday. Sheets name are calendar dates in mmdd format
View 4 Replies
View Related
Sep 24, 2009
I was wondering if it is possible to prevent a macro from running depending on what value is in a specified cell.
I have a huge excel sheet and a commandbutton that runs a bunch of macros in order to generate a report.
I want to force the user to select a specific project before all the macros are run. Just making the report for a specific project only takes a few seconds but if no project is selected then it runs throught the whole database and it takes forever.
I have set up a cell that changes value depending on wether a project is selected or not. I have placed the cell in the -ForMacros- sheet. Now is it possible to write some code into the commandbutton that halts the report generation + displays a warning box telling the user to select a project first?
What values used to determine wether the macro runs or not doesnt matter to me. Whatever is easier for you
I have attached a sample workbook for you to work on.
View 6 Replies
View Related
Jul 31, 2006
when i put a file across a network, it should be shared among all the users, but it appears as read only file and the option of track changes in the tools function is disabled. However, when i open an excel file in a stand alone pc, and use the track changes option, i get the file as (shared) as the header. what is the significane or meaning of this word "shared" in a stand alone pc?
View 2 Replies
View Related
Oct 23, 2006
I accidently put the Application.Quit command in the wrong place. Now Excel closes immediately when the macro executes. I can get into Excel if I disable the macro, but then it won't let me edit the macro. Is there a way to edit my macro without executing it?
View 7 Replies
View Related
Jan 17, 2007
My macros don't work when the workbook is shared. They are not stored in my personal workbook and so are available to all users. What's going on?
View 3 Replies
View Related
Oct 3, 2007
How do I disable a custom menu item when a user is entering data in a cell?
For example... when the formula bar in Excel has focus, and a user tries to select Data > Sort, the Sort item is disabled. But when the focus is back to the worksheet, Data > Sort is enabled.
I need to do the same thing for my custom menu items.
View 5 Replies
View Related
Apr 10, 2009
I want my worksheet to require validation of entry data before printing, so I decided to use the "Workbook_BeforePrint" event, and display a simple dialog box with an "ok" or a "cancel" button as input options.
The problem is that, as coded, "cancel" button does not cancel the print.
View 2 Replies
View Related
Nov 1, 2013
I have a protected worksheet which enables only certain sections to be edited, data inputs etc. I also have a set of rows grouped which need to be activated depending on data type for particular projects to be captured. Problem is, when the sheet is protected, when users click on the + and - buttons to either ungroup and group the rows depending on type of project, this feature is disabled.
I get a popup alert that tells me "You cannot use this command on a protected worksheet. To use this command you must first unprotect the sheet ....". Problem is I don't want all users to have access as giving them the password defeats my purpose of protecting the sheet.
See the attached file, row 23.
View 9 Replies
View Related
Feb 23, 2003
I have a file that contains Macros that I want to share with others. The only problem I have is that users have the right to enable or disable macros. If they disable the macro - some of the security functions could be lost.
Is there a way to create a macro that will not allow the file to be opened if they choose to Disable the Macros.
View 9 Replies
View Related
Oct 26, 2012
I have a workbook in Excel2010 with 2 sheets. I have put in a conditional formatting in 27177 cells. After a lot of waiting it finally worked out and the cells that should turn RED, do show correctly. The strange thing is that my "filter by color" stays disabled. This applies both to the columns I've applied the conditional formatting to, as well as any other column that has a colored cell.
The second sheet in the file also have colored cells and there the option works perfectly fine. So it seems to have something to do with the particular sheet.
why the function got disables in the particular worksheet.
View 1 Replies
View Related
Jun 10, 2014
I do have a VBA that runs in the report. For whatever reason this stops excel back button (or CRTL Z) from working. What would i need to change in order for back button to work?
I know it is due to this VBA since all other spreadsheets are working fine and as soon as i open this spreadsheet undo button stops functioning.
Private Sub Worksheet_Calculate()
Dim MyPic As Picture
Me.Pictures.Visible = False
Pictures("Picture 11").Visible = True
With Range("AH1")
For Each MyPic In Me.Pictures
If MyPic.Name = .Text Then
[code].....
View 1 Replies
View Related