Marco to run every day at 12

B

bris

Hi here

I've need some help to some macro programming.
I'm using excel for getting external data from an other database. Now I want
to build a macro that refresh the data at e.g 12 p.m. every day.
Any hint for making this macro that do this refreshing every day at a
defined time??

Br,
Brian
 
A

arno

Hi bris,
to build a macro that refresh the data at e.g 12 p.m. every day.

one way is to enter your code to refresh data in the auto_open makro/event
of a workbook. start excel and the workbook with a "scheduled task" of
windows.

regards

arno
 
B

Bob Phillips

Brian,

Look at the OnTime method in VBA Help. This will enable you to schedule a
macro for a selected time.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
A

arno

Hi Robin,

the problem that i have with this sort of stuff is that it is absolutely not
sure what's going on. has user x the file open, did he start the macro, did
he close excel after starting, is he on holiday/ill/on tour etc. etc. etc.

this is why i'd recommend running a scheduled tasks, the PC/Server has to be
turned on and that's it.

arno
 
B

bris

Hi Arno

Thanks for your answer. I face a new problem.When using this scheduled task,
this opens the excel file, but stops when excel says "contain marco.
Is there a way of disable this popup message?

Br,
Brian
 
A

arno

Thanks for your answer. I face a new problem.When using this scheduled
task,
this opens the excel file, but stops when excel says "contain marco.
Is there a way of disable this popup message?

you have to set macro security to low to avoid this message.

this is a security risk, however, if you are working often with excel files
with macros you'll have to set security to low 'cause otherwise you'll go
crazy when prompted every time you open an excel file. usually, virus
scanners would interfere when opening a workbook with a macro-virus, if your
only protection against viruses is excel's macro security then you have a
problem anyway.

arno
 
Top