Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old August 25th, 2003, 12:49 PM
Mira Mira is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Germany - Grasberg
Posts: 1 Mira User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy VBA-Excel-Autostart-Macro

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???

Reply With Quote
  #2  
Old August 25th, 2003, 09:59 PM
mohecan mohecan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Melbourne, Australia
Posts: 212 mohecan User rank is Private First Class (20 - 50 Reputation Level)mohecan User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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?

Reply With Quote
  #3  
Old August 26th, 2003, 02:48 AM
Silian's Avatar
Silian Silian is offline
Gogga
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 198 Silian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > VBA-Excel-Autostart-Macro


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway