Problem mit Excel



  • hallo,

    ich will ein paar daten in excel exportieren, aber wenn ich eine ExcelApplication oder ExcelWorksheet komponente auf meine form ziehe und compilieren will, bekomme ich immer folgende fehler:

    [C++ Error] ComCtrls.hpp(2638): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
      [C++ Error] ComCtrls.hpp(2839): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
      [C++ Error] ComCtrls.hpp(3430): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3431): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3435): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3477): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3577): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3640): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3641): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3652): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3657): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3699): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(3706): E2015 Ambiguity between 'Menus' and 'Excel_2k::Menus'
      [C++ Error] ComCtrls.hpp(4140): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
      [C++ Error] ComCtrls.hpp(4259): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
      [C++ Error] ComCtrls.hpp(4429): E2015 Ambiguity between 'Windows' and 'Excel_2k::Windows'
      [C++ Error] StdActns.hpp(459): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(488): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(516): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(569): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(579): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(605): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(612): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(696): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(703): E2015 Ambiguity between 'Dialogs' and 'Excel_2k::Dialogs'
      [C++ Error] StdActns.hpp(703): E2228 Too many error or warning messages
    

    kann mir einer helfen, das ganze zum laufen zu bringen???bei google habe ich nur russische sacehn dazu gefunden^^



  • Hallo

    kann ich nicht nachvollziehen.
    Kommen diese Fehler auch bei einem leeren Form mit einem ExcelApplication?

    bis bald
    akari



  • nein.
    ich habe noch folgende dateien eingebunden:

    #include <vcl\Controls.hpp>
    #include <vcl\Forms.hpp>
    #include <vcl\Graphics.hpp>
    #include <vcl\Classes.hpp>
    #include <vcl\Windows.hpp>
    #include <vcl\System.hpp>
    #include <StdCtrls.hpp>
    #include <Grids.hpp>
    #include <Dialogs.hpp>
    


  • Hallo

    Die zusätzlichen Includes machen in meinen neu erstellten Projekt mit der ExcelApp keinen Unterschied.

    bis bald
    akari



  • ich habe das problm jetzt naderst gelöst:

    einfach dei komponenten rausgeschmissen und dafür alles auf diese art gemacht:

    Variant MyEx;
        Variant MyWB;
        Variant MyWS;
    
        MyEx = CreateOleObject("Excel.Application");
        MyEx.OlePropertySet("Visible" , true);
    
        MyWB = MyEx.OlePropertyGet("Workbooks");
        MyWB.OleFunction("Add");
    
        MyWS = MyWB.OlePropertyGet("Item" , 1);
        MyWB = MyWS.OlePropertyGet("Worksheets");
    
        MyWB.OlePropertyGet("Item" , 1).OlePropertySet("Name", 1);
    
        MyWS = MyWB.OlePropertyGet("Item" , 1);
    
        MyWS.OlePropertyGet("Cells" ).OlePropertyGet("Item", 2,2).
            OlePropertyGet("Font").OlePropertySet("Bold" , true);
        MyWS.OlePropertyGet("Cells").OlePropertyGet("Item", 2,2).
            OlePropertySet("Value" , StringToOleStr(title));
    
        [...]
    

Anmelden zum Antworten