Adek1243 wrote:...what i must writeing in A1 when is "FOLDERPATH_or_FolderURL"...
The default folder is the one you keep the 'batchAndDdeSourceExample_2.ods' in. Column A may be used to override this default, but I didn't thoroughly check and test this facility. Usage not recommended - except
you did the check.
The first sheet 'Batch' acts as a container for files (identified by names) to be processed by the included code.
The column F there receives a new date-time-stamp if the respective file actually existed and was processed.
"f1.odt" and "f2.doc" are placeholders for two of
your files you want to process, and which you need to move to the same folder as you keep the
batchAndDdeSourceExample_2.ods I provided in. You also need to enter their actual names then contiguously into column B (and an existing filtername into column C if needed).
When testing on
my system the files were very banal examples I had created for the testing only. The 'f2.doc' was derived from 'f1.odt' by saving to the alien fileformat and only for proving absent the capability of
.doc to store working DDE links - at least when exported from LibO. (I have no native Word files at my disposition.)
Also
only for testing I created the second sheet 'ExampleDDElinkedTable' containing the source for a DEE link only used for a linked TextTable in f1.odt.
When I developed and tested, no errors occurred. The existence of any given file is checked by the code before trying to open it. I don't understand the error message you reported, and you missed to tell for what line of Basic code it was thrown. The line of code (line 55) you quoted and reported to stop execution is under control of line 44 testing for the existence. This seems inconsistent to my understanding, and I'm afraid I cannot clear this up without sitting next to you at your computer.
My advice can only be: Execute the code stepwise, take the opportunity to understand it, and check specifically how you can get to line 55 with a nonexisting file despite line 44.
Though its only an ugly toy, I attach my experimental f1.odt now. Remember that it must be placed into the same folder as the 'batchAndDdeSourceExample_2.ods'.
First of all make sure that you don't use the older faulty 'batchAndDdeSourceExample.ods'.
If there is another problem, please don't wait a week or more to report it. Needing to understand my sparsely commented code from 10 days ago again takes me quite a time. If you are decisive to do such things by macros, you anyway need to develop your debugging skills.
Now the banal file for testing. Users understanding the code and being aware of the nature of this file don't need to download it. They should also delete the second sheet from my
.ods.
- f1.odt
- (10.92 KiB) Downloaded 188 times
Edit:
InsertCode: Select all If NOT (Right(r_foUrl, 1)="/") Then r_foUrl = r_foUrl & "/"
as the new line 42 into the code (subsequent lines get their numbers increased by 1 then) - or assure you will give folder paths with a terminating slash (for Win paths: backslash).
The original question anticipated the default folder to be mandatory. I don't like unnecessarily specialized code, however, and therefore wanted to provide a way to work with different folders. Sorry! I didn't test the facility.
|
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München