Delete a file on disk using libre office macro

I am opening a csv file in using LibreOffice Calc and processing the data in it.
This csv file is periodically auto-generated on the disk by another application.
I wish to delete this csv file from disk after opening & processing the data is finished.
How to do it using macro? (either python or vba or else). (The macro can be assigned to a button for single-click operation).

Thanks,

Vineet

Hi, Vineet .

> wish to delete this csv file from disk ・・・How to do it using macro? (either python or vba or else)

Dose vba means LibreOffice Basic( LO Basic ) ?

If so, you use “kill” on LO Basic.

When you write macro using python, you use “remove” or “kill”.

You can see the following URL for the sample code;

[ LO Basic ]
Sample 1( use "com.sun.star.ucb.SimpleFileAccess" service )
  URL 1:  http://openoffice3.web.fc2.com/OOoBasic_General.html#OOoGB2A
Sample 2( not use "com.sun.star.ucb.SimpleFileAccess" service )
  URL 2: http://openoffice3.web.fc2.com/OOoBasic_General.html#OOoGB2B

[ Python ]
Sample 1( remove )
  URL 1: http://openoffice3.web.fc2.com/Python_Macro_General_No2.html#OOoGF13a
Sample 2( use "com.sun.star.ucb.SimpleFileAccess" service )
  URL 1: http://openoffice3.web.fc2.com/Python_Macro_General_No2.html#OOoGF13b

Thanks mate for your reply. Sorry, I could not reply to your answer in time. Let me go through the url’s given by you.