IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MFC Discussion :

Excel et c++ [FAQ]


Sujet :

MFC

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut Excel et c++
    Bonjour je dévellope sous visual c++ et j'arrive pas à trouver comment on utilise Excel (je veux juste entrer des valeurs et mettre excel en forme)
    Le tutoriel sur Borland C++ builder ne marche pas
    et je commence vraiment à desespérer!!!!
    merci de m'aider

  2. #2
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut Re: Excel et c++
    Citation Envoyé par maeva
    Bonjour je dévellope sous visual c++ et j'arrive pas à trouver comment on utilise Excel (je veux juste entrer des valeurs et mettre excel en forme)
    Le tutoriel sur Borland C++ builder ne marche pas
    et je commence vraiment à desespérer!!!!
    merci de m'aider
    tu parles de quel version d'EXCEL ?
    je ne connais pas "Le tutoriel sur Borland C++ builder", mais précise ce qui ne marche pas (passe-t-il par Automation => je pourrais t'aider)...

  3. #3
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    le tuto est ici :http://lfe.developpez.com/Excel/
    en fait j'ai pas la librairie utilcs
    mais si tu connais une autre façon ça m'interrese!
    merci d'avoir répondu si vite

  4. #4
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    Ok,
    bon j'ai lu en diagonale -> il utilise OLE Automation
    quel version de builder utilises-tu ?
    A tu fait une recherche sur ton disque de 'utilcls.h' ?

    NB: d'ailleur tu as ecrit utilcs au lieu de utilcls, faute de frappe ?

  5. #5
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    tu devrais le trouver dans ...\CBuilder5\INCLUDE\VCL\utilcls.h

  6. #6
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    justement j'utilise visual c++ et j'ai fait une recherche et j'ai pas utilcls.h!

  7. #7
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    justement j'utilise visual c++ et j'ai fait une recherche et j'ai pas utilcls.h!
    ah bon ! ben c'est normal alors !
    parce que en visual C++ ça marche pas comme ça...
    donc ce tuto ne compileras pas, à moins que tu le modifie !

    la doc MSDN (qui normalement accompagne Visual C++) regorge d'exemple sur excel, donc un qui s'appelle 'Automating Microsoft Office 97 and Microsoft Office 2000'.

    si tu as d'autres questions, n'hésite pas !

  8. #8
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    olala MSDN moi qui ai trop de mal en anglais je vais regarder merci beaucoup en tout cas

  9. #9
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Par défaut
    Citation Envoyé par maeva
    olala MSDN moi qui ai trop de mal en anglais je vais regarder merci beaucoup en tout cas
    http://msdn.microsoft.com/library/fre

  10. #10
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    merci pour le site en français mais j'avais déjà regardé et j'ai pas trouvé d'exemple
    Sinon j'ai pas compris grand chose mais j'ai trouvé ça:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
     
    #import "C:\Program Files\Microsoft Office\Office\MSO9.DLL"
    #import "C:\Program Files\Fichiers communs\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" no_namespace
    #import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB"no_namespace
     
     
    using namespace std;
     
    int main()
    {
      // Initialize COM
      CoInitialize(NULL);
      try
      {
        Excel::_ApplicationPtr excel;
        // Initialize Excel and make sure it's initialized
        HRESULT hr = excel.CreateInstance(L"Excel.Application");
        if(FAILED(hr))
        {
          char msg[1024] = {0};
          sprintf(msg, "E: There was an error initializing Excel: %d", hr);
          throw std::runtime_error(msg);
        }
     
        Excel::_WorkbookPtr workbook = excel->Workbooks->Add(static_cast<long>(Excel::xlWorksheet)); // Create the workbook
        Excel::_WorksheetPtr worksheet = excel->ActiveSheet; // Get the active sheet
     
        // This is how you put the values into the worksheet
        worksheet->Range["A1"]->Value = "Hello"; // Set a value
     
        worksheet->SaveAs("c:\\test.xls"); // Save it
        workbook->Close(); // Close the workbook
        excel->Quit(); // Quit excel
      }
      catch(_com_error &ce)
      {
        // Handle the error
      }
      CoUninitialize();
    mais il y a des erreurs à la compil

  11. #11
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    voilà ça marche maintenant
    mais j'ai un petit problème comment agrandir ma colonne et encadrer une cellule!
    merci d'avance

  12. #12
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    mais j'ai un petit problème comment agrandir ma colonne et encadrer une cellule!
    enregistre une macro qui fait ce que tu veux et regarde le code généré en VBA, avec un peu d'adaptation tu pourras trouver ce qu'il faut faire en C++.

    NB: avant tu devrais de renseigner COM, les 'typelib' et les 'smart pointer', même si c'est pas vraiment nécessaire pour ton cas.

  13. #13
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    merci pour tout
    il y a encore l'alignement que je n'arrive pas à modifier parce qu'il ne connait pas Alignement .(worksheet->Range["A11"]->Font->FontAlignment = 4
    mais je vais essayé de cherché mais en c++ il n'y a pas d'exemple c'est lourd!
    encore merci

  14. #14
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    Citation Envoyé par maeva
    il y a encore l'alignement que je n'arrive pas à modifier parce qu'il ne connait pas Alignement .(worksheet->Range["A11"]->Font->FontAlignment = 4
    d'après le MSDN, l'objet Font n'a pas de propriété (ou même de méthode) FontAlignment , es-tu sur de toi ?

  15. #15
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    oui je pense parce que pour ce qui suit ça marche bien
    worksheet->Range["A11"]->Font->Size = 20;
    worksheet->Range["A11"]->Font->Name = "MS Sérif";

  16. #16
    Membre confirmé
    Inscrit en
    Novembre 2007
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Novembre 2007
    Messages : 132
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    #import "C:\Program Files\Microsoft Office\Office\MSO9.DLL"
    #import "C:\Program Files\Fichiers communs\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" no_namespace
    #import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB"no_namespace
     
     
    using namespace std;
     
    int main()
    {
    // Initialize COM
    CoInitialize(NULL);
    try
    {
    Excel::_ApplicationPtr excel;
    // Initialize Excel and make sure it's initialized
    HRESULT hr = excel.CreateInstance(L"Excel.Application");
    if(FAILED(hr))
    {
    char msg[1024] = {0};
    sprintf(msg, "E: There was an error initializing Excel: %d", hr);
    throw std::runtime_error(msg);
    }
     
    Excel::_WorkbookPtr workbook = excel->Workbooks->Add(static_cast<long>(Excel::xlWorksheet)); // Create the workbook
    Excel::_WorksheetPtr worksheet = excel->ActiveSheet; // Get the active sheet
     
    // This is how you put the values into the worksheet
    worksheet->Range["A1"]->Value = "Hello"; // Set a value
     
    worksheet->SaveAs("c:\\test.xls"); // Save it
    workbook->Close(); // Close the workbook
    excel->Quit(); // Quit excel
    }
    catch(_com_error &ce)
    {
    // Handle the error
    }
    CoUninitialize();
    j'ai essayé d'utiliser ce code mais j'ai rencontré beaucoup de problemes au moment de la compilation :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    c:\documents and settings\administrateur\bureau\test\debug\mso9.tlh(931) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(315) : error C2367: 'IFilter' : redefinition; different uuid specifiers
            c:\program files\microsoft visual studio\vc98\include\comdef.h(455) : see declaration of 'IFilter'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(535) : error C2367: 'Window' : redefinition; different uuid specifiers
            c:\documents and settings\administrateur\bureau\test\debug\vbe6ext.tlh(310) : see declaration of 'Window'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(537) : error C2367: 'Windows' : redefinition; different uuid specifiers
            c:\documents and settings\administrateur\bureau\test\debug\vbe6ext.tlh(33) : see declaration of 'Windows'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(567) : error C2367: 'AddIn' : redefinition; different uuid specifiers
            c:\documents and settings\administrateur\bureau\test\debug\vbe6ext.tlh(1499) : see declaration of 'AddIn'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(1257) : error C2371: 'WindowPtr' : redefinition; different basic types
            c:\documents and settings\administrateur\bureau\test\debug\vbe6ext.tlh(121) : see declaration of 'WindowPtr'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(1273) : error C2371: 'AddInPtr' : redefinition; different basic types
            c:\documents and settings\administrateur\bureau\test\debug\vbe6ext.tlh(149) : see declaration of 'AddInPtr'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(1334) : error C2923: '_com_IIID' : 'Rectangle' is invalid as template argument '#1', type expected
            c:\program files\microsoft visual studio\vc98\include\wingdi.h(3215) : see declaration of 'Rectangle'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(1338) : error C2923: '_com_IIID' : 'Arc' is invalid as template argument '#1', type expected
            c:\program files\microsoft visual studio\vc98\include\wingdi.h(2608) : see declaration of 'Arc'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : error C2039: 'MsoDiagramNodeType' : is not a member of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : error C2146: syntax error : missing ',' before identifier 'nodeType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : error C2061: syntax error : identifier 'nodeType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2616) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2616) : error C2146: syntax error : missing ',' before identifier 'nodeType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2616) : error C2061: syntax error : identifier 'nodeType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2630) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2631) : error C2504: '_IMsoDispObj' : base class undefined
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2645) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2645) : error C2146: syntax error : missing ';' before identifier 'Diagram'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2645) : error C2501: 'IMsoDiagramPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2645) : error C2208: 'struct Diagram' : no members defined using this type
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2654) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2654) : error C2146: syntax error : missing ',' before identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2654) : error C2061: syntax error : identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2659) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2659) : error C2146: syntax error : missing ',' before identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2659) : error C2061: syntax error : identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2668) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2668) : error C2146: syntax error : missing ',' before identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2668) : error C2061: syntax error : identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2677) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2677) : error C2146: syntax error : missing ';' before identifier 'GetDiagram'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2677) : error C2501: 'IMsoDiagramPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2678) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2678) : error C2146: syntax error : missing ';' before identifier 'GetLayout'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2680) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2680) : error C2146: syntax error : missing ',' before identifier 'pdgmType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2680) : error C2061: syntax error : identifier 'pdgmType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2688) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2688) : error C2146: syntax error : missing ',' before identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2688) : error C2061: syntax error : identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2694) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2694) : error C2146: syntax error : missing ',' before identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2694) : error C2061: syntax error : identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2703) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2703) : error C2146: syntax error : missing ',' before identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2703) : error C2061: syntax error : identifier 'pos'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2720) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2720) : error C2011: 'Office' : 'enum' type redefinition
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2720) : error C2143: syntax error : missing ',' before '*'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2720) : error C2059: syntax error : '*'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2722) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2722) : error C2143: syntax error : missing ',' before '*'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2722) : error C2059: syntax error : '*'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2724) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2724) : error C2146: syntax error : missing ',' before identifier 'pdgmType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2724) : error C2061: syntax error : identifier 'pdgmType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5785) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5785) : error C2146: syntax error : missing ',' before identifier 'SyncEventType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5785) : error C2061: syntax error : identifier 'SyncEventType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5880) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5880) : error C2146: syntax error : missing ',' before identifier 'SyncEventType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5880) : error C2061: syntax error : identifier 'SyncEventType'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5942) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5942) : error C2146: syntax error : missing ';' before identifier 'Assistant'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5942) : error C2501: 'AssistantPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5942) : error C2501: 'Assistant' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5944) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5944) : error C2146: syntax error : missing ';' before identifier 'CommandBars'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5944) : error C2501: '_CommandBarsPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5944) : error C2501: 'CommandBars' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5998) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5998) : error C2146: syntax error : missing ';' before identifier 'COMAddIns'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5998) : error C2501: 'COMAddInsPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(5998) : error C2501: 'COMAddIns' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6008) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6008) : error C2146: syntax error : missing ';' before identifier 'LanguageSettings'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6008) : error C2501: 'LanguageSettingsPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6008) : error C2501: 'LanguageSettings' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6012) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6012) : error C2146: syntax error : missing ';' before identifier 'AnswerWizard'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6012) : error C2501: 'AnswerWizardPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6012) : error C2501: 'AnswerWizard' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6076) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6076) : error C2146: syntax error : missing ';' before identifier 'FileSearch'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6076) : error C2501: 'FileSearchPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6076) : error C2501: 'FileSearch' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6078) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6078) : error C2146: syntax error : missing ';' before identifier 'FileFind'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6078) : error C2501: 'IFindPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6078) : error C2501: 'FileFind' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6118) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6118) : error C2146: syntax error : missing ';' before identifier 'NewWorkbook'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6118) : error C2501: 'NewFilePtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6118) : error C2501: 'NewWorkbook' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6134) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6134) : error C2146: syntax error : missing ';' before identifier 'FileDialog'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6134) : error C2501: 'FileDialogPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6134) : error C2501: 'FileDialog' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6324) : error C2027: use of undefined type 'Office'
            c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(2598) : see declaration of 'Office'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6324) : error C2146: syntax error : missing ';' before identifier 'GetAssistant'
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6324) : error C2501: 'AssistantPtr' : missing storage-class or type specifiers
    c:\documents and settings\administrateur\bureau\test\debug\excel.tlh(6324) : fatal error C1003: error count exceeds 100; stopping compilation
    Error executing cl.exe.
     
    test.exe - 102 error(s), 1 warning(s)

  17. #17
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 397
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 397
    Par défaut
    Essaie en supprimant les no_namespace.
    Ensuite, tu pourra rajouter les using namespace pour corriger les autres erreurs...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  18. #18
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    oui je pense parce que pour ce qui suit ça marche bien
    worksheet->Range["A11"]->Font->Size = 20;
    worksheet->Range["A11"]->Font->Name = "MS Sérif";
    autant je comprends ce que veux dire 'Size' et 'Name' pour une police, autant je ne vois pas à quoi peut ce rapporter 'FontAlignment'...

    NB: je confirme, il n'existe AUCUNE propriété 'FontAlignment' pour aucun des objets MSOffice: ce DOIT être une erreur !

  19. #19
    Membre habitué
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 12
    Par défaut
    je cherchais quelque chose qui centre le texte dans la cellule
    voilà

  20. #20
    Membre expérimenté Avatar de Grulim
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    234
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2004
    Messages : 234
    Par défaut
    je cherchais quelque chose qui centre le texte dans la cellule
    alors, je pense que tu cherches la propriété 'HorizontalAlignment'...
    ça nous donne donc, d'après ton code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    worksheet->Range["A1:D1"].HorizontalAlignment  = xlCenter

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. [VB6] [Excel] Résultat d'une requete ds une feuille
    Par elifqaoui dans le forum VB 6 et antérieur
    Réponses: 12
    Dernier message: 07/01/2003, 17h52
  2. [VBA-E] [Excel] Filtrer le donnees d'une sheet
    Par donia dans le forum Macros et VBA Excel
    Réponses: 6
    Dernier message: 27/09/2002, 10h55
  3. [Kylix] kylix et excel
    Par gothe dans le forum EDI
    Réponses: 1
    Dernier message: 19/09/2002, 19h44
  4. Réponses: 2
    Dernier message: 22/07/2002, 12h13
  5. [Kylix] Excel via kylix
    Par Billy joel dans le forum EDI
    Réponses: 1
    Dernier message: 23/05/2002, 11h57

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo