Hi, I am a newbie in the field macros. I have a folder with lots of xls files. In part, the resulting files as output format. Ods had and were then modified by someone using a batch in. Xls. Thus, this data can no longer process with MS Excel since then a large salad data arises. Now to my question. Is it possible that I get a macro where open about Libre all the files in the folder once with Libre and saved as. Xls? Batch processing? Is that even possible? Thanks for your help. Thomas tomyw Posts: 3 Joined: Wed, 12/18/2013 14:38
Hello Tomyw, I know not why you want to save the files in. Xls, but the following method stores or format the current document table in the xls format. Code: Select all sub Export_To_XLS () dim arg (0) as new com.sun.star.beans.PropertyValue dim sURL as String arg (0) Name = "Filter Name" arg (0) Value = "MS Excel 97".. sURL = ConvertToUrl ("c :/ sample folder / Samples.xls") this.Component.storeAsURL (sURL, arg ()) end sub I hope this helps you further for the time being? Greeting Matthias koernems Posts: 4 Joined: Wed, 02/10/2013 13:44
Hello Matthias, Thank you for your help. Unfortunately it did not quite work as I thought. Is probably because I have described it wrong. So I have a folder C: \ test run in this folder there are about 10000 files with the extension xls Some of the files were as already written times saved as a ods file and placed in this folder... At some point, someone has simply renamed all the files using batch in. Xls. If these files are opened with LibreOffice's all true and I can once again Neat save as. Xls so that these can be recognized and processed with an import into an Access database by hand. Now I had thought that I just open with Libre let the 10000 files via macro and save from Libre out in. Xls. The "new" files should sawgrass mills mall hours be in a different folder C: will be stored \ test running. The file name should stay exactly as the original file. I hope I do not be too nerve with the topic. But somehow this got to do it by hand is very time consuming. Regards and Thanks for the help! Thomas tomyw Posts: 3 Joined: Wed, 12/18/2013 14:38
So incidentally: Even Excel can handle Calc files, newer versions of out of home, for older Microsoft provides an appropriate plugin available. sawgrass mills mall hours Related Links: Why want to abuse their LibreOffice for the task? Would not it be easier sawgrass mills mall hours to use a shell script, Python script, Perl script ... all zip archives from 10000 files rauszufischen? The files thus obtained could be converted selectively. That should also run much faster. Zip archives way because ODF documents are managed as Zip archives. The programming of the script can even take the colleague who has unceremoniously renamed everything. Greeting lorbass lorbass ******** Posts: sawgrass mills mall hours 3158 Joined: Mon, 01.05.2006 20:29 Location: Bonn
Yes the Excel open the calc files can I also noticed. However, I would like to have the files then read into an Access DB. I've already sawgrass mills mall hours made. However, Access has the problem just then written to these files since the data in the DB salad. which really does not look great and contains sawgrass mills mall hours no real data. Can anyone here help me for this amount of data? Would be really great. Would like to thank with ner small donation. Regards Thomas tomyw Posts: 3 Joined: Wed, 18/12/2013 14:38
So, I'm fresh out of the Christmas holiday back so the belated answer to your question, I hope it helps you even more. Code: Select all REM ***** BASIC ***** dim url, url2 as String sub init () url = ConvertToUrl sawgrass mills mall hours ("C: \ test run") url2 = ConvertToUrl ("C: \ test-running") readdir ( ) end sub sub readdir () dim oUcB as object dim flist () oUcb = createUnoService ("com.sun.star.ucb.SimpleFileAccess") if oUcb.isFolder (url) then flist = oUcb.getFolderContents (url, False) else msgbox sawgrass mills mall hours ("Error") end if Open_XLSFiles (flist ()) end sub sub Open_XLSFiles (flist () as String) dim arg (0) as new com.sun.star.beans.PropertyValue 'arg (0). Name = " Filter Name "'arg (0). Value =" MS Excel 97 "for i = 0 To UBound (flist ()) if not isReadOnly (flist (i)) then if Sta
No comments:
Post a Comment