Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


Hallo,

unter Anwendung von Thomas' Makro-Code-Beispiel der Vollständigkeit halber in Zusammenfassung:

Mit einem Programm [2] extern ein Makro [1] aufrufen und - ohne das bereits existierende CALC-Dokument sichtbar zu öffnen - in der ersten Tabelle (von links nach rechts gezählt) in die Zelle "A1" die Zeichenkette "Hello world !" schreiben.

Gruß
Hans-Werner

[1] Makro

Sub RunMacroHidden

Dim oC       as Object ' object Cell
Dim oD       as Object ' object Document
Dim PathFile as String
Dim aPV(0)   as New com.sun.star.beans.PropertyValue

PathFile = "E:\TMP\RunMacroHidden.ods"

aPV1(0).name  = "Hidden"
aPV1(0).value = True

oD = StarDesktop.loadComponentFromURL(ConvertToURL(PathFile),"_blank",0,aPV())
oC = oD.Sheets(0).getCellRangeByName("A1")
oC.string = "Hello World!"
oD.store()
oD.close(true)

end sub

[2] Externer Makro-Aufruf (hier mit "Perl"-Code):

use strict;
use warnings;

my $L; # Libre Office
my $M; # Makro

$L = "C:/Program Files/LibreOffice 5/program/soffice.exe";
$M = "macro:///Standard.Temporary.RunMacroHidden";

`"$L" --nologo "$M"`;

--
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? https://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: https://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: https://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.