Autosave / Autoclose After Inactivity [Roy's Code]
Dec 13, 2008
I have seen a number of discussions on this subject. I used Roy's code posted here and wanted to make a small change. I want to give the user a warning msg, few minutes before the autoclose would be scheduled to occur. This would give the user a chance to change cell selction or do somethig to reset the timer. If the message goes unanswered, the autoclose should occur as scheduled.
I am attaching a workbook with the macros installed in workbook, standard module and worksheet.
It dosn't seem to do what I want. It seems to work, but it acts differently everytime I run it.
Can someone please look at the attached workbook and help me fix it?
View 12 Replies
ADVERTISEMENT
Dec 1, 2008
I am using the following macro code on a protected unshared workbook used by multiple users across an intranet and am trying to implement 2 additions to the macro
1. Disable the startup Autoclose message text box for users who open the file using 'Read Only' or 'Notify'.
2. Change the code so that the ShutDown clock resets itself if the mouse is moved, a new cell is selected, a new worksheet is selected, or a new workbook is selected. Basically, I want to keep the workbook open for any sort of user activity.
The problem I am running into is that the workbook will still autoclose on a user who is simply tabbing between workbooks to view data, or simply using the mouse to select new cells.
View 7 Replies
View Related
Jan 4, 2008
Is it possible to disable the autosave feature in vba?
View 3 Replies
View Related
Mar 11, 2009
I want to close a spreadsheet on a timed event. i can manage the timed close but i need to reset the timer if any action occurs. I have attached what i have so far...
View 4 Replies
View Related
Sep 2, 2004
I picked this code up off this board but it isn't quite working. After 5 minutes it activates the message. However, if no option is selected by the user, it just sits there because it is waiting for a user response and doesn't actually save and close the workbook.
Private Sub Workbook_Open()
Application.OnTime (Now + TimeValue("00:05:00")) - TimeValue("00:00:30"), "Message"
End Sub
Sub Free()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub
Sub Message()
Cuser = Environ("username")
continue = MsgBox("This workbook will save and close in 30 seconds unless you press NO.", vbYesNo, "Hello " & Cuser)
If continue = vbNo Then
Application.OnTime (Now + TimeValue("00:05:00")) - TimeValue("00:00:30"), "Message"
Else
Call Free
End If
End Sub
View 9 Replies
View Related
Nov 26, 2012
I have a menu workbook with macro buttons that call different workbooks. Call the menu workbook (switchgear.xlsm). Switchgear contains 2 buttons. Button 1 closes switchgear and opens Book1. Button 2 closes switchgear and opens book 2.
If book1 is open and nothing has changed for 3 minutes I would like it to close and open switchgear.xlsm. I do not want it to just close in 3 minutes... I want it to close after 3 minutes of inactivity.
I have search all over and tried and tried to achieve this without success...
I have been able to get the timer to work but it gets caught in a loop. If I open book1 and close it in less than a min then 3 minutes later out of nowhere the code tries to run???
Secondly when this happens I see several book1 vba projects loaded in the editor window???
View 9 Replies
View Related
Jun 9, 2009
I have this code, and it's not working: ...
View 9 Replies
View Related
Sep 11, 2009
Is there a way that I can have an excel document "autosave"?
Specificaly I would like: If a value in a specific cell's value is changed I would like the document to automatically save the document as the name of the value that is typed into that cell when the user closes the document.
I'm not sure if this is possible, but it would be great if there was some way to do this.
View 14 Replies
View Related
Nov 30, 2011
I am trying to use the following macro to autosave a document to a pdf file. It works except it always saves it as the same name. Is there a way I can make it save it and when it saves it, title it as the contents in cell A5?
Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:UsersTRFoundationDesktop529431.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
View 2 Replies
View Related
Jun 21, 2013
I have macro enabled workbooks that the contract number increases by one everytime they are opened. Is there a way to make it auto save though when its opened. Right now I have to click save as soon as I open it. If I do not do this when I open it, when I open it again the contract number will stay the same as it was, because I save it at the end after I put all customer info in.
View 8 Replies
View Related
Oct 7, 2008
I'm trying to write a macro in excel that will save the document every couple of minutes. After searching the forums here for a bit I found something that might work:
Sub test()
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 30
waittime = TimeSerial(newHour, newMinute, newSecond)
Do
ActiveWorkbook.Save
Loop
End Sub
The only thing about this is that it runs constantly and won't stop saving. Is there a way to do this where it will only save every 5 minutes or so?
View 9 Replies
View Related
Apr 14, 2009
I am using the following code to automatically save the workbook when excel is being closed.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Close SaveChanges:=True
End Sub
This seems to be working fine (in the respect that when the user closes excel it saves this file without a prompt), the issue i have (and i appreciate it is a small issue) is that excel remains open but without any open workbooks. Is there a way i can amend my code so that excel closes too.
View 9 Replies
View Related
Apr 12, 2005
I m executing some macros in my file. After executing I need to save my file automatically (which is already saved). Means I dont need to press "CTRL + S".
View 4 Replies
View Related
Aug 11, 2009
I have copied the below coding from the forum.
View 3 Replies
View Related
Nov 12, 2005
I have just upgraded from excel 2000 to excel 2003 I have always set autosave to 5 minutes in case I press the wrong button as I did tonight. I also had autosave set to save all open workbooks
I am a heavy user of excel and often have many workbooks open at the one time.
View 12 Replies
View Related
Nov 9, 2009
I wonder if anyone could help with some VBA code to automatically save a copy of a workbook on a monthly basis (Say the 1st of each month, or the nearest date to that if it has not been saved on the 1st.)
I would like this to be done without user input, and to be saved with the current workbook name + the current date. It can also be saved in the current workbook folder. I am using Win XP Pro and Excel 2003. This would also obviously need to check if the file currently exists, we can say the filename is Cars and the directory is C:Data. Finally I do not wish to stop the users from saving their own version with save or save as.
View 9 Replies
View Related
Jan 2, 2010
Please review the following and advise the one Best Connection needs to save in Excel 5.0/95 format without prompting me about incompatability issues
Sub Tomo() ....
View 9 Replies
View Related
Oct 28, 2008
As before my code sequentially opens over 200 workbooks, extracts data from each of them and pastes it into a register. I do get the occasional workbook which has some links in it which cannot be immediately updated and so Excel produces a requestor window asking if I want to Continue or Edit Links. I always want to Continue and wonder how I can code this. I presume this will be something to do with this line of code?
View 2 Replies
View Related
Jan 27, 2009
I use excel 2002 but some of my office are on 97, i want to add a small workbook open event code which works for me but debugs for the others?? The code is basically, go to a tab, on that tab and that range sort..
View 2 Replies
View Related
Feb 8, 2007
I've developed a little software using Excel Macros & VB. To prevent people from accesing the code I protected the code blocking it from visualization. It seems not enough as an acquaintance of a friend cracked it in 25 minutes. Or so he says. So I'd like to know if there is a better way to protect the font code.
View 8 Replies
View Related
Mar 9, 2013
I have an excel file having part code,name,vendor and Qty ( Quantity ).
My problem is that I want to apply an excel formula to pick up that vendor code who have highest Qty of a part code.The condition is that S.No.should not be disturbed.This file is so large,but here I have taken an example,
View 2 Replies
View Related
May 12, 2009
I am dealing with several very large spreadsheets using VBA to do various things. I found that my code worked well, but was taking a long time to run. The biggest time consumer was my use of the AutoFilter features. I have since turned calculations to manual before my code runs and set it back to auto when my code is done running. What are the potential consequences of my turning calculations to manual and then back to auto?
View 2 Replies
View Related
Dec 6, 2012
I have previously used the following code to successfully pull out IE webpage source code for string manipulation.
Its a crude example to demonstrate the principle:
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public IE As Object
Sub Sample()
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
[Code] ......
However when I substitute in a Google websites address into the IE.Navigate command, the code runs to the "Source_Code = IE.document ...." line then flags up a Microsoft Visual Basic error. "Run-time error '438': Object doesn't support this property or method"
The webpage that I am trying to access is a confidential company site, so you won't be able to access it yourself, but starts with [URL] ......
The one thing that I have noticed about this website is the Privacy Report icon in the lower right status window (Picture of an eye with a restricted symbol in front). I don't know whether this is the cause of my problem, or purely an incidental observation.
Is there something peculiar with Google sites that means that the source code cannot be extracted in general, or is this an issue specific to my site ? Does the Privacy Report icon have any relevance, and if so how do I switch that off ?
Using :
MS Excel 2010
IE Explorer 8.0
View 1 Replies
View Related
Aug 1, 2013
My company has files that are already in use. I don't know too many details about how they work, but somehow saving the file will screw it up and my boss has to go back and reset something or other to correct it. Obviously it's connected to some other software somewhere. The code below will block Save and Save-As. BUT how do I get the file to hold onto the code without actually saving the file after the code is added (since the file shouldn't be saved)?
VB:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = False Then
Cancel = True
[Code].....
View 1 Replies
View Related
May 13, 2009
I have some buttons in different sheets in an excel file, each button has its own code, that is the reason I can not move the code related to each object to another location (sheet or module).
And I have one piece of code in Module1 (Auto_load) in order to execute automatically this routine every time file is opened. Inside "auto_load" routine I initialize some values of some check buttons,options buttons and positions of some objects in diferent sheets, but I can not pass the value of variables between Module and Sheet's code even when I declare as public variables and/or function.
I have the following structure: ...
View 11 Replies
View Related
Jul 24, 2009
I'm trying to write a VBA script which will delete all rows in my Excel spreadsheet where Column I (which contains a status code) does not contain the word "Completed".
At the moment, I'm doing this the other way round: my script is able to search for entries in Column I which contain the status codes "Pending", "Awaiting Authorisation", "In Progress" etc and delete them. The idea is that when all those rows are deleted, I'll only be left with rows which have a status of "Completed". This works fine at the moment. However, the concern is that if a brand new status code is added to the data file, my script would be unable to pick it up and delete it. This is a small sample of the code I'm currently using (which deletes all the rows with statuses other than Completed):
View 4 Replies
View Related
Jul 30, 2009
I am trying to determine how to get the code below to fire whenever cell J10 is populated and do nothing when cell J10 is not populated but I can't quite get it. (Cell J10 is manually changed and is not changed based off of a formula)
View 4 Replies
View Related
Jul 25, 2014
Is there a standard way to organize sections of code with code tags? Due to the nature of my work, there is a lot of documentation involved. And, my spreadsheets rely heavily on VBA. These code tag sections will be going into a design specification, so that there is a layer of traceability from the document to the program. These are the general sections or item numbers that I've come up with.
1. Dimensions and Variables
2. Data
3. Processing the Data
4. Rules of analysis
5. Analysis
6. Formatting
I guess I'm looking for something standard like UML diagrams for DFDs, but with tagging code to break them up into sections?
View 4 Replies
View Related
Feb 2, 2009
I am using the code below that I got off of these forums to email a particular sheet in my workbook, but I need to strip all of the VBA code and the command button from the sheet being sent.
View 14 Replies
View Related
Feb 6, 2009
Can someone explian to me this line of code in eglish specially after the .Count /14-1
View 2 Replies
View Related