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!

Delete file from Sharepoint with Access VBA

Status
Not open for further replies.

osera

Technical User
May 15, 2006
35
0
0
US
Good afternoon.

I'm trying to have an Access database automatically create an Excel spreadsheet and save it to Sharepoint when the database is first opened on any given day. The end user wants the file in Sharepoint to have the same name every day, so I can simply replace the previous file with the new version.

The problem I'm having is that Access won't overwrite the previous file with the new data. I need to delete the old file before the database can save the new version. I'd like to do this through VBA. The more I take out of the hands of my end users, the less stuff I have to fix later. I've tried using this:

Kill "<Sharepoint URL>/sites/<folder>/<subfolder>\<filename.xlsx>"

But when I run the code, I get Run-time error '53'. File not found.

Is it possible to delete an Excel file from Sharepoint using Access VBA?

Thank you.
 
That did it. Adding "CreateBackup:=False" to the command to save the new file replaced the old one in Sharepoint.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top