"Set Warnings" - Set but still get warnings

R

Robin Chapple

I have used "Set Warnings" to No so that I can overwrite regular
reports and thus delete the older version.

I have just built a macro which outputs four reports in the same way
as above.

This time I am getting a warning that the "File already exists"

Can this be raised out side the macro?

Thanks,

Robin Chapple
 
D

Douglas J. Steele

I believe "File already exists" is an error, not a warning.

You need to check whether or not the file already exists, and if it does,
delete it before trying to write to it.

To be honest, I'm not sure how you'd do that in a macro: I never use them.
It's simple in a VBA module, though.
 
S

Steve Schapel

Robin,

Doug is right, this can't be done with a macro. You would need to use
the Kill method in a VBA procedure to delete the file first.
 
R

Robin Chapple

Thanks Guys,

I hear what you say but I have other macros that make files on a
weekly basis for reporting purposes and they *DO* overwrite the
previous version. They have been running for years.

I'll convert the macro to VBA.

Robin
 
R

Robin Chapple

Doug and Steve,

Humble pie eating day.

Conversion to VBA was the answer and that is what happened to the
existing ones long ago.

"Old Timer's Disease" is thriving. My apologies.

Robin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top