Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro Help

Status
Not open for further replies.

trent101

Programmer
Nov 4, 2005
50
AU
Hey,

What im trying to do is convert a dbf file to a tab delimited file. Now I can do this by opening the dbf file up in Excel and then simply save it as a tab delimited file, but it my situation it needs to be done every half an hour so I really need a way to automate the process.

I was told that I could use Excel VBA to automate the process, but I have a few questions.

I know how to create a macro in excel to do what I need to do, but how am I going to automate it? Is there anyway I can run the script from a batch file or something similar?

Thanks for your time.
 
Put your routine in a loop (until some event) and include either a wait (Pauses a running macro until a specified time. Returns True if the specified time has arrived.
Important The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue.
expression.Wait(Time)
expression Required. An expression that returns an Application object.
Time Required Variant. The time at which you want the macro to resume, in Microsoft Excel date format.
),
or the OnTime method (Schedules a procedure to be run at a specified time in the future (either at a specific time of day or after a specific amount of time has passed).
expression.OnTime(EarliestTime, Procedure, LatestTime, Schedule)
expression Required. An expression that returns an Application object.
)

_________________
Bob Rashkin
 
Start off by turning on your macro recorder (Tools > Macro > Record New Macro) and go through the steps to convert the file.

As far as automation goes, here (cpearson.com) is a pretty good explanation of how to use the OnTime method. Here (ozgrid.com) is another.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
ok,

thanks for your help, solved my problem.

cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top