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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overwriting old data

Status
Not open for further replies.

phil009

Technical User
Jun 2, 2004
63
US
I am running a macro which uses the "OutputTo" function in order to send my query results to an Excel workbook. (I not using "Transferspreadsheet" because I want Excel to start up immediately after I export the data.) I am currently getting a message that says the file I am exporting, "specificCompany", already exists would I like to replace it? Is there anyway to make it so that this message does not appear. I tried turning the warnings off but that didn't work.

If anybody has any ideas it would be great,
Phil
 
You may consider the Kill function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the quick reply PHV, but you explain the "Kill" function a little bit more. I guess I'm not quite sure what you're talking about.

Thanks,
Phil
 
That last post should have said "could you explain"

Sorry about that
 
First sorry for my typo, should be read:
Take a look at the Kill instruction.
While in VBE (Alt-F11) open the immediate window (Ctrl-G), type kill and press F1.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Right now I am trying to use the kill function and it doesn't seem to be working. The code I am using is:
Code:
Kill "G:\Finance\2004\Analysis\Compete\CS-54\CS54 Files - Escanaba Excluded\Competitive\all companies.xls"

If anybody sees what is wrong please let me know.

Thanks,
Phil
 
Nevermind it works now for some strange reason. Thanks anyways though.

Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top