Force Users To Close Via Macro Button
Sep 12, 2009
I have a spreadsheet that has a button named Exit Requisition Program on it to close the application with. When the button is used everything is wonderful. All of the data on the sheet is saved and the application closes. I have a problem with some users clicking the red X without saving changes and that creates a big problem.
What I need to do is any one of several things.
1. Remove the red X completely.
2. Deactivate the red X.
3. Have a message box pop up instructing the user to use the Exit Button when the red X is used. Any one of the three methods listed above would work for me.
View 2 Replies
ADVERTISEMENT
Aug 6, 2007
I have a sheet which is protected but people are still able to change cell formats etc if they use the standard paste method. I want people to be able to paste data in but it forces paste special values to stop people pasting formats etc over already formatted and locked cells.
I know I could write a macro and run it using the shortcut keys ctrl-v but then the users lose the ability to undo if they make a mistake.
Is there a way to force paste special or allow users to run a macro but be able to do undo if they make a mistake?
View 9 Replies
View Related
Oct 11, 2006
I need to know the command to close a workbook. I have used the information found here: http://www.ozgrid.com/VBA/userform-close.htm to disable closing the workbook via the upper right "X", but I need a button that, when clicked, simply closes the workbook instead.
View 2 Replies
View Related
Feb 13, 2009
I have two CHECK BOXES, one says YES and the other says NO
directly after the user opens the worksheet and enables the macros
I want a pop up message box to appear directing them to check YES or NO and not allow them to do anything else until one of the two is checked
once either box is checked, they can continue on to filling in the rest of the worksheet
View 9 Replies
View Related
Dec 14, 2011
I have a list box in a user form using R2:R3 as Row source.
I need to force the users to choose one of the items and not allow a blank entry to be entered.
I used the code below for the entries however it still allows for a blank to be entered into the Cell.
This part of the code works for Me.sapor = "" Or Me.jobna = "" Or Me.ordernu = "" But not for the next (2) list boxes it allows blanks Or Me.snd = "" Or Me.mcode = ""
Me.Snd and Me.mcode are list boxes.
Code:
If Me.sapor = "" Or Me.jobna = "" Or Me.ordernu = "" Or Me.snd = "" Or Me.mcode = "" MsgBox ("Feilds SAP Number, Job Name, Price, Code and Month Code Must be Completed")
Exit Sub
Code:
Private Sub CommandButton1_Click()
Dim rNextCl As Range
' Row count = where the select cell finishes and window box moves to rows over
' offset = howmany cells up or down from the row count
[Code]....
View 2 Replies
View Related
Feb 17, 2014
I have this VBA set for a workbook_open event:
Public Sub Workbook_Open()
PromotionOrNewHireForm.Show
Sheet1.Select
End Sub
...which works, but I would prefer to have the form hide (or unload, exit, etc.) once the toggle button in that userform is first selected. I've tried a few things but none of them have worked. BTW, the userform has two toggle buttons, which run the following:
Private Sub ToggleButton1_Click()
Worksheets("Sheet1").Range("A4").Value = "Promotion"
End Sub
Private Sub ToggleButton2_Click()
Worksheets("Sheet1").Range("A4").Value = "New Hire"
End Sub
Also, once it closes, I'd like it to move on to the next macro depending on whether "Promotion" or "New Hire" is selected. Not sure if a workbook_change event is the best way to handle that.
View 1 Replies
View Related
Feb 16, 2009
Hi, The purpose of this macro was to control the time this excel file was open because many users modify it. I decided to create a splash screen (userform) to display a message to the user saying "your session time of 15min is up"
The problem is, the first time I open the file everything works fine. But after I close it (just the workbook not excel), It opens itself for some reason and gives me a debug error message. Perhaps the timer is never stopped?
I call "StartTimer10min" on workbook open and "StopTimer" before workbook close.
View 11 Replies
View Related
Dec 24, 2012
I have user form which allow user to entry their inputs in required boxes (Like TxtFirstName, TxtLastName etc.)
My form is working but which I want is that users should first fill up txtFirstName Text Box. Otherwise we will not able to do edit his/ her name in the last Name Text Box (TxtLastName).
Is there any way to do that?
View 1 Replies
View Related
Oct 4, 2010
Is there anyway to easily disable/dim the Excel Close (X) Button as I want to force my users to close an Excel workbook via a button?
View 9 Replies
View Related
Sep 3, 2013
I know how to add a save and close button but i do not know how to make it instantly available in every new workbook that i open. Currently i click the button and it looks for the macro in the first excel book that i created it in.
how do i make that macro become a default in every workbook?
View 1 Replies
View Related
May 20, 2006
i have a command button on a userform which closes the work book, i also want it to close xl. i have tried the following:
Private Sub CommandButton2_Click()
ThisWorkbook.Close
xl.close
End Sub
View 8 Replies
View Related
Mar 16, 2012
I have a User form which had a button which redirects me to a certain sheet, e.g. If I wanted to go to stock sheet I would click cmdViewStock and it would open the stock worksheet meaning it works, but the userform still stays open. Is there a way in which once I click the cmdViewStock it opens the Stock worksheet but closes the userform automatically straight after?
Here is the current code I have for the button:
Code:
Private Sub cmdViewStock_Click()
Sheets("Stock").Select
Sheets("Stock").Range("B4").Select
End Sub
View 2 Replies
View Related
Feb 6, 2007
most of the users always like to click the close (x) button on the top right of the userform ... and when that happens the application that was set hidden will remains hidden and other users in the network cannot access it ... eventhough i've placed an exit button inside the userform, users still prefer to click the x button.
View 5 Replies
View Related
May 16, 2006
Sample code on disabling the close button in Excel workbook?
I tried the Tool -> Protect -> Check Windows method. But, it will disable the maximize and minimize buttons as well. Moreover, it will minimize the workbook.
View 2 Replies
View Related
Jan 10, 2014
Why I receive a 400 error when the 'excel close' button is pressed in the attached sample.
View 2 Replies
View Related
May 30, 2009
I want a list to be sorted when a user closes the Excel DataForm. I have the code to execute the sort but how do I attach it to the DataForm Close button?
View 9 Replies
View Related
Jul 16, 2007
I have a useform that loads up with two buttons and I waat to force the user to chose one of the buttons. However, I have noticed that the user can just press the cross in the top right corner of the form to close the window and therefore not press either button.
Is there anyway I can stop the close form button working?
View 4 Replies
View Related
Jun 3, 2014
How to disable the default close button in a workbook not to affect in my command button close.
I tried already cancel = true but my command button close is also been canceled.
View 3 Replies
View Related
Mar 25, 2014
I have a problem on auto-sorting my data after clicking the "x" or "Close" button on DataForm. Im creating a command button that trigger a macro to open an autofill DataForm. I want a code that everytime i ADD or EDIT using the DataForm, it will automatically sort the Column A after clicking the "x" or "Close" button. Below is the code of my macro:
Code:
Sub OpenForm()
Sheets("DATA").Select
ActiveSheet.ShowDataForm
End Sub
View 1 Replies
View Related
Apr 15, 2008
I have a fairly elaborate close-down routine for my workbook.
1) Quit out of fullscreen (restore initial state of excel before saving)
2) Hide all sheets but one (enforces cant do anything unless macros enabled)
3) Automatically save without a prompt
4) Close the workbook
I've researched it well and implemented it to the point where it works, but only if the user clicks the excel application close button -- the "X" in the titlebar (hence not in fullscreen).
However, if I launch the process via a userform button click, then for some reason the
DisplayFullscreen = False, Sheets hiding, and save codes have no effect (fullscreen persists, sheets are not hidden, no file is saved) in the Workbook_BeforeClose() subroutine....
I repeat: all the above works fine if process was launched by "native" excel button, but does not have any effect if launched from a userform commandbutton. (?!?!) any ideas what's going on?
I'm including my code so you can get an idea how it's structured.... by it's pretty "by the forum" as far as I can tell...
Private Sub CloseButton_Click()
If(1) Then
'Method 1 - close directly from userform command button
With ThisWorkbook
'.RunAutoMacros (xlAutoClose)
.Close
End With
Else
'Method 2 - set a timer to call a function to perform
' "ThisWorkbook.close" in a function outside of the userform
CustMenuCloseTimer = Now + TimeSerial(0, 0, 2)
Application .OnTime CustMenuCloseTimer, "CustMenu_CloseAction"
End If
End Sub
View 3 Replies
View Related
Mar 4, 2009
I have Excel file that is linked to Access Database. Everytime the user opens the file, there is pop up message that warns the user we there to enable the macro or to disable it. I want to force the user to enable the macro or even better if I can make disappear this warning and automatically enable the macro. See attached for more details.
View 3 Replies
View Related
Mar 22, 2012
I have this running and Section A is working but Section B is not. I basically want it so that if conditions a, b, and c occur, excel pops up with that messagebox.
Condition A: Cells(8, 3) changes via formula referencing an outside cell
Condition B: The new value of Cells(8,3) is a numeric value.
Condition C: The change in it's value is not more than a given threshold
change as defined in Cells(8, 13)
why the second section is not popping up with a msgbox when the value of Cells(8, 3) changes.
Public bbb as long
Sub Other()
bbb = Cells(8, 3)
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim bb As Integer
Dim cc As Integer
[code]....
View 4 Replies
View Related
Dec 17, 2009
I've created a file where our accountmanagers can mace price calculations. But eversince i've added a macro to force them to fill the form completely, they have gone and tried to hack the macro (and with succes).
I now would like to add a protection for the macro, so they can only access VBA when "sheet1" is unprotected. How can i do this?
I also would like to create a macro so they only can save the file as a Macro Enabled Excel file (.xlsm),
how can i do this best? .....
View 9 Replies
View Related
Jan 7, 2014
How do I share a macro(s) to other users so they can use it? Each user has different location because we are working remotely.
View 1 Replies
View Related
Feb 8, 2007
I have a workbook that pulls in index data from Bloomberg, most data is updated realtime, but one index we track is only updated late at night. I want to write a macro that will refresh all of the data in the worksheet and then save a snapshot of the workbook. I have all the code for saving the snapshot, but getting the data for the one index to refresh is proving difficult. None of the standard ways I know to refresh external data (both Excel commands via tools menu, and Bloomberg specific refresh commands) seem to work on these cells. The only way so far I've found to get these cells to pull in current data is to delete them and rewrite the formulas.
suggestion for a Macro that would force a refresh of this data?
View 7 Replies
View Related
Apr 7, 2014
I want to use it to get data from snmp and put it in excel cell. I managed to do this with this macro:
[Code] .....
Now I want to be able to change the IP address. For example in cell A4 to fill the IP. And the IP to change in the macro. So this macro to be use for different hosts.
I place a button for this macro and when I press it a cmd windows is popping for 1 second and hide. How can I make it not to show at all.
View 1 Replies
View Related
Apr 6, 2009
When saving a file, you get a popup with a suggested path. I need to find a macro that will either offer a suggested file name based on a cell's date value (a1) and a suggested path (to the desktop) for any user that uses the spreadsheet - or simply will save the file using the cell value as the name to the user's desktop.
Each user will have their own version of the file, to save to their own desktop. The macro will need to overcome the issues that each user's path to their desktop will be unique since each will have logged in to the window's session with their own profile.
View 5 Replies
View Related
Jan 4, 2009
I am in need of a macro that will allow users to delete an entry in a named range as well as delete a range named the same. I would like the macro to open a list showing the contents of a range named "Locations". Once opened the users may select a name from the list and click on a button to remove that item from the named range. the macro can then delete the cell that name is in and shift the remaining cells up, changing the range. Second the macro should delete a named range that matches the one the user selects. once delete I would like to have a pop say "Location Removed Sucessfully".
View 9 Replies
View Related
Feb 18, 2010
I have been using excel for years but have always managed to resolve issues using formula's etc but now i have had to step into the realms of macro's. I am slowly learning but urgently need help with the below problem which is bound to be a simple solution.
I have compiled a workbook for users to administrate on a daily basis. (each worksheet is a different day of the month but the same template) There are a few hidden worksheets as the info is extracted from these to run reports.
The issue/s i have is that administrators use cut, copy and paste to repeat data opposed to retyping, this messes formats, formulas and validation up. I have used a macro from the net to remove this option and it works fine. Problem is that if they do not enable macro's this will cease to be an option.
I understand that you cannot remove the option of enabling macro's but you can force. Again used a macro from the web that if you don't enable it only shows a welcome page saying that macro's need to be enabled to use. (all others are hidden) if macro's are enabled the welcome page disappears and the worksheets 1-31 reappear. Again this worked fine.
I tried putting both macro's into the same workbook but kept coming up with errors, each one i resolved led to another.
So short of it i need a instructions/macro to force macros and remove cut copy and paste.
View 14 Replies
View Related
Oct 26, 2008
I would like to modify one of my UserForms so the close button [the "X" in the upper corner] will not be visible. [It does not matter if this must involve hiding the upper the title bar - or not - as long as the little "X" will vanish].
I would like to point out that I DO NOT want to disable the "X" fronm closing the form [that I know how to accomplish] I just want to get rid of it. I have been told to look for a good example in a file called: "NoCloseButton.zip", created by Stephen Bullen, at http://www.bmsltd.ie/Excel/Default.htm but had no success in finding the file.
View 5 Replies
View Related