Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Excel Workbooks werden trotz Visible:=False angezeigt (https://www.delphipraxis.net/190653-excel-workbooks-werden-trotz-visible-%3Dfalse-angezeigt.html)

DavidKlimas 22. Okt 2016 16:19

Delphi-Version: 10 Seattle

Excel Workbooks werden trotz Visible:=False angezeigt
 
Guten Abend Community,

ich habe folgenden Code um ein Excel Workbook zu öffnen :

Delphi-Quellcode:
   
Var
  vMSExcel : OLEVariant;
Begin
    vMSExcel := CreateOleObject('Excel.Application');
    vMSExcel.Visible := False;
    vMSExcel.Workbooks.Open(PPath);

    //Do something with the file

    vMSExcel.DisplayAlerts := False;
    vMSExcel.Workbooks[1].Close(False);
    vMSExcel.Quit;
    vMSExcel := unassigned;
Wenn ich xlsm Dateien öffne klappt die Funktion super, allerdings bei xls und xlsx Dateien wird das Workbook trotz "vMSExcel.Visible := False" im hintergrund angezeigt. Was kann ich machen um das Workbook nicht anzuzeigen ?

Danke

DavidKlimas 22. Okt 2016 16:56

AW: Excel Workbooks werden trotz Visible:=False angezeigt
 
Hab das Problem gefunden. Das Excel Workbook war zwischen mehreren Benutzern geteilt ("Shared"). Wenn die Teilung aufgehoben wird, klappt alles super.


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:58 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz