×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Delete file from Sharepoint with Access VBA

Delete file from Sharepoint with Access VBA

Delete file from Sharepoint with Access VBA

(OP)
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.

RE: Delete file from Sharepoint with Access VBA

Hmmm, somebody has other problem - Excel SaveAs overwrites SharePoint file without request

Do you do:
ActiveWorkbook.SaveAs Filename:="AC_XYZ.xlsm", CreateBackup:=False


---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Delete file from Sharepoint with Access VBA

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

Thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close