|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hello Peoples,
I start an Excel-VBA Macro automatically, when my Excel-File is getting open. But I search for a method to have a type of manual facility to cancel this auto-start-macro by clicking a button or anything else. It should be waiting for example 30 seconds and if there was no manual activity, it should be running. Can anybody understand my english and help me??? |
|
#2
|
|||
|
|||
|
You could use the VB Wait command.
Which would "pause" a running macro for x amount of time. Search the VBA help file for delay for more info.
__________________
How can I soar like an eagle when I'm flying with turkey's? |
|
#3
|
||||
|
||||
|
Thnkx 2 vb help file (don't sue me!)
Code:
Dim iTime
Private Sub Workbook_Open()
iTime = Now + TimeValue("00:00:15")
Application.OnTime iTime, "macro1"
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
MsgBox ("change")
Application.OnTime EarliestTime:=iTime, _
Procedure:="macro1", Schedule:=False
End Sub
Add this to your thisWorkbook code. It will run macro1 unless the workbook changes. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > VBA-Excel-Autostart-Macro |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|