Hi Niraj,
thanks fort he information. Sorry for my fault. Posted the topic there.
Von: platform-swt-dev-bounces@xxxxxxxxxxx [mailto:platform-swt-dev-bounces@xxxxxxxxxxx]
Im Auftrag von Niraj Modi
Gesendet: Freitag, 12. Dezember 2014 15:50
An: Eclipse Platform SWT component developers list.
Betreff: Re: [platform-swt-dev] swt ole and ExcelMacroSheet
Hi Max,
Please use SWT community forum:
https://www.eclipse.org/forums/index.php/f/100/ for
such queries.
This mailing list is meant for developers discussions.
Thanks,
Niraj
From: Lerchenmüller Maximilian <m.lerchenmueller@xxxxxxxxx>
To: "platform-swt-dev@xxxxxxxxxxx"
<platform-swt-dev@xxxxxxxxxxx>
Date: 12/12/2014 03:56 PM
Subject: [platform-swt-dev] swt ole and ExcelMacroSheet
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
Dear Community Members,
I’m trying to open up an ExcelMacroSheet (.xlsm) with swt.
The Sheet is opened and displayed correctly. But there is a Macro in the Sheet which is called on Workbook_Open(). There the Macros craches, because it can’t find ActiveWorkbook.Path and ActiveWorkbook.Name.
The ActiveWorkbook Variable doesn’t seem to be set.
Also if opened via OleClientSite it seems that there is created an copy of the VbaProject in the workbook every time it gets opened.
Can anybody please help?
Here goes the current code:
Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("Excel Demo");
shell.setSize(640, 480);
shell.setLayout(new FillLayout());
frame = new OleFrame(shell, SWT.NONE);
clientSite = new OleClientSite(frame, SWT.NONE, "Excel.SheetMacroEnabled.12", new File(“FILEPATH”));
clientSite.doVerb(OLE.OLEIVERB_UIACTIVATE);
shell.open();
shell.addDisposeListener(new DisposeListener()
{
public void widgetDisposed(DisposeEvent event)
{
MessageBox messageBox = new MessageBox(shell, SWT.YES | SWT.NO);
messageBox.setText("Achtung");
messageBox.setMessage("Änderungen abspeichern");
int buttonID = messageBox.open();
switch(buttonID)
{
case SWT.YES:
clientSite.save(new File(fileName), true);
break;
case SWT.NO:
// exits here ...
break;
}
}
});
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
clientSite.deactivateInPlaceClient();
clientSite.dispose();
Thanks in advance,
Max
|
|
|
|
|
|

|
|
|
Otto Bihler Maschinenfabrik GmbH & Co. KG
|
|
|
Lechbrucker Str. 15
|
|
|
87642 Halblech
|
|
|
Deutschland
|
|
|
http://www.bihler.de
|
|
|
|
|
|
Maximilian Lerchenmüller
|
|
|
IT/Business
|
|
|
|
|
|
Tel:
+49-8368/18-226
|
|
|
Fax:
+49-8368/18-181
|
|
|
Ust-ID-Nr.: DE 128 288 234
Sitz Halblech, Registergericht Kempten, HR A 325
Persönlich haftende Gesellschafterin:
Otto Bihler Maschinenfabrik Verwaltungs-GmbH,
Sitz Halblech, Registergericht Kempten, HR B 2981
Geschäftsführer: Mathias Bihler, Manfred Grundner
Bitte beachten Sie, dass dies eine urheberrechtlich geschützte, vertrauliche Mitteilung ist. Wenn Sie nicht der richtige Adressat sind, oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte den Absender und löschen Sie diese E-Mail. Das unerlaubte
Kopieren sowie die unbefugte Weitergabe dieser E-Mail und der darin enthaltenen Informationen sind nicht gestattet.
Jede von uns versendete E-Mail ist virengeprüft. Dennoch schließen wir, außer für den Fall von Vorsatz oder grober Fahrlässigkeit, die Haftung für jeglichen Verlust oder Schäden durch virenbefallene Software oder E-Mails aus.
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev