Ask Your Question
0

delete a file on disk using libre office macro [closed]

asked 2013-08-14 13:57:51 +0200

Vineet gravatar image

updated 2013-08-14 14:01:29 +0200

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

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-07 02:21:03.350185

1 Answer

Sort by » oldest newest most voted
0

answered 2013-08-17 16:10:30 +0200

newOOo3 gravatar image

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

edit flag offensive delete link more

Comments

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.

Vineet gravatar imageVineet ( 2013-09-29 07:50:24 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-14 13:57:51 +0200

Seen: 1,024 times

Last updated: Aug 17 '13