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

Deleting a file on SharePoint

Status
Not open for further replies.

LGMan

MIS
Aug 27, 2003
233
GB
Here's the rub, I have a small application that first sends an macro enabled workbook to a folder on a SharePoint site, lets call it Book1.xlsm a co-worker downloads the file, does what they need to and a macro saves the file as Book1_Completed.csv and sends back to SharePoint to load into a database. Book1.xslm is no longer any use and is not needed
What I'd like to do is be able to delete the Book1.xlsm from the SharePoint site from within the VBA, but alas have no idea on how its done.
If there is anything to point me tin the right direction, it would be great as the SharePoint site is filling up as quick as I can manually delete the 'used' files
 
Are you saying you want your Book1.xlsm to delete itself? For this file to commit a suicide?
To delete other file you would use VBA’s [tt]Kill[/tt] command, but I don’t think the file can delete/kill itself.


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
;-) Thisworkbook.Seppuku [fumanchu]

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Hi, Book1.xlsm gets downloaded and saved to a temporary folder on the co-workers PC, it's at this point that I believe the SharePoint file can be deleted from within the code of that file now held in the temporary folder.

The temporary file is worked on, then it gets saved as Book1_Completed.csv and uploaded to SharePoint.
 
Well, I've found it's possible by using the sharepoint address as it appears in windows explorer such as "\\SharePint\...."
Code:
Dim SP_File as String
Set SP_File = "\\SharePoint\.....\Book1.xslm"
'more code here....
Kill (SP_File)


 
BTW, you cannot [highlight #E9B96E]Set[/highlight] a string variable!

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top