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

VB.NET Discussion :

message d'erreur sur System.Runtime.InteropServices


Sujet :

VB.NET

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    175
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Canada

    Informations forums :
    Inscription : Juillet 2008
    Messages : 175
    Points : 50
    Points
    50
    Par défaut message d'erreur sur System.Runtime.InteropServices
    salut,
    jai le message d'erreur suivant:
    System.Runtime.InteropServices.COMException (0x80080005): La récupération de la fabrique de classe COM pour le composant avec le CLSID {00024500-0000-0000-C000-000000000046} a échoué en raison de l'erreur suivante : 80080005 dans une fonction qui genere un fichier excel depuis une base de donnee malgre que toutes les references sont ajoutees.

    Merci pour votre aide

  2. #2
    Inactif  
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Janvier 2007
    Messages
    6 604
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 63
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC

    Informations forums :
    Inscription : Janvier 2007
    Messages : 6 604
    Points : 13 314
    Points
    13 314
    Par défaut
    Sans donner la source, on risque pas d'avoir une idée.

    Je ne réponds pas aux questions techniques par MP ! Le forum est là pour ça...


    Une réponse vous a aidé ? utiliser le bouton

    "L’ennui dans ce monde, c’est que les idiots sont sûrs d’eux et les gens sensés pleins de doutes". B. Russel

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    175
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Canada

    Informations forums :
    Inscription : Juillet 2008
    Messages : 175
    Points : 50
    Points
    50
    Par défaut message d'erreur sur System.Runtime.InteropServices
    merci pour ta reponse:
    la fonction qui genere ce message est la suivante:
    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
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
     
    Private Sub fct_fill_excel(ByVal lines() As String, ByVal sqltype As String)
            Dim line_0() As String
            Try
     
                Dim line_1() As String
                Dim line_2() As String
                Dim line_3() As String
                Dim line_x() As String
                Dim i As Integer
                Dim strsql As String
                Dim qty As Decimal
                Dim S1, ErrStr As String
                Dim po_xl As Excel.Application
                Dim po_book As Excel.Workbook
                Dim po_sheet As Excel.Worksheet
     
     
                If sqltype = "PO" Or sqltype = "MA" Then
     
                    'lines(0)
                    line_0 = Split(Replace(Replace(lines(0), Chr(34), ""), "'", " "), ";")
     
                    'lines(1)
                    line_1 = Split(Replace(Replace(lines(1), Chr(34), ""), "'", " "), ";")
     
                    'lines(2)
                    line_2 = Split(Replace(Replace(lines(2), Chr(34), ""), "'", " "), ";")
     
                    'lines(3)
                    line_3 = Split(Replace(Replace(lines(3), Chr(34), ""), "'", " "), ";")
     
                    'Création des settings pour la gestion du po dans excel
                    po_xl = New Excel.Application
                    'po_xl = CreateObject("Excel.Application")
     
                    If line_1(1) = "E" Then
                        'po_book = po_xl.Workbooks.Open(Filename:=layout_e)
                        po_xl.Workbooks.Open(Filename:=layout_e)
                    Else
                        'po_book = po_xl.Workbooks.Open(Filename:=layout_f)
                        po_xl.Workbooks.Open(Filename:=layout_f)
                    End If
                    po_sheet = po_xl.ActiveSheet
                    po_xl.Visible = False
                    'Création de l'entête du PO
                    'to
                    If line_3(1) <> "" And line_3(2) <> "" Then
                        po_sheet.Cells(2, 7) = line_2(0).ToUpper
                        po_sheet.Cells(3, 7) = line_3(0).ToUpper
                        po_sheet.Cells(4, 7) = line_3(1).ToUpper
                        po_sheet.Cells(5, 7) = line_3(2).ToUpper
                        po_sheet.Cells(6, 7) = line_3(3).ToUpper & ", " & line_3(4).ToUpper & "  " & line_3(5).ToUpper
                        po_sheet.Cells(7, 7) = line_3(6).ToUpper
                    ElseIf line_3(1) = "" And line_3(2) = "" Then
                        po_sheet.Cells(2, 7) = line_2(0).ToUpper
                        po_sheet.Cells(3, 7) = line_3(0).ToUpper
                        po_sheet.Cells(4, 7) = line_3(3).ToUpper & ", " & line_3(4).ToUpper & "  " & line_3(5).ToUpper
                        po_sheet.Cells(7, 7) = line_3(6).ToUpper
                    ElseIf line_3(1) <> "" And line_3(2) = "" Then
                        po_sheet.Cells(2, 7) = line_2(0).ToUpper
                        po_sheet.Cells(3, 7) = line_3(0).ToUpper
                        po_sheet.Cells(4, 7) = line_3(1).ToUpper
                        po_sheet.Cells(5, 7) = line_3(3).ToUpper & ", " & line_3(4).ToUpper & "  " & line_3(5).ToUpper
                        po_sheet.Cells(7, 7) = line_3(6).ToUpper
                    ElseIf line_3(1) = "" And line_3(2) <> "" Then
                        po_sheet.Cells(2, 7) = line_2(0).ToUpper
                        po_sheet.Cells(3, 7) = line_3(0).ToUpper
                        po_sheet.Cells(4, 7) = line_3(2).ToUpper
                        po_sheet.Cells(5, 7) = line_3(3).ToUpper & ", " & line_3(4).ToUpper & "  " & line_3(5).ToUpper
                        po_sheet.Cells(7, 7) = line_3(6).ToUpper
                    End If
     
                    'ship to
                    If line_2(6) <> "" And line_2(7) <> "" Then
                        po_sheet.Cells(2, 15) = line_2(21).ToUpper
                        po_sheet.Cells(3, 15) = line_2(14).ToUpper
                        po_sheet.Cells(4, 15) = line_2(6).ToUpper
                        po_sheet.Cells(5, 15) = line_2(7).ToUpper
                        po_sheet.Cells(6, 15) = line_2(8).ToUpper & ", " & line_2(9).ToUpper & "  " & line_2(10).ToUpper
                        po_sheet.Cells(7, 15) = line_2(12).ToUpper
                    ElseIf line_2(6) = "" And line_2(7) = "" Then
                        po_sheet.Cells(2, 15) = line_2(21).ToUpper
                        po_sheet.Cells(3, 15) = line_2(14).ToUpper
                        po_sheet.Cells(4, 15) = line_2(8).ToUpper & ", " & line_2(9).ToUpper & "  " & line_2(10).ToUpper
                        po_sheet.Cells(7, 15) = line_2(12).ToUpper
                    ElseIf line_2(6) <> "" And line_2(7) = "" Then
                        po_sheet.Cells(2, 15) = line_2(21).ToUpper
                        po_sheet.Cells(3, 15) = line_2(14).ToUpper
                        po_sheet.Cells(4, 15) = line_2(6).ToUpper
                        po_sheet.Cells(5, 15) = line_2(8).ToUpper & ", " & line_2(9).ToUpper & "  " & line_2(10).ToUpper
                        po_sheet.Cells(7, 15) = line_2(12).ToUpper
                    ElseIf line_2(6) = "" And line_2(7) <> "" Then
                        po_sheet.Cells(2, 15) = line_2(21).ToUpper
                        po_sheet.Cells(3, 15) = line_2(14).ToUpper
                        po_sheet.Cells(4, 15) = line_2(7).ToUpper
                        po_sheet.Cells(5, 15) = line_2(8).ToUpper & ", " & line_2(9).ToUpper & "  " & line_2(10).ToUpper
                        po_sheet.Cells(7, 15) = line_2(12).ToUpper
                    End If
                    '# cmd
                    po_sheet.Cells(10, 1) = line_2(1).ToUpper
                    'Date cmd
                    If line_1(1) = "E" Then
                        po_sheet.Cells(10, 5) = line_2(2).Substring(3, 2) & "/" & line_2(2).Substring(6, 2) & "/" & line_2(2).Substring(0, 2)
                    Else
                        po_sheet.Cells(10, 5) = line_2(2).Substring(6, 2) & "/" & line_2(2).Substring(3, 2) & "/" & line_2(2).Substring(0, 2)
                    End If
                    'Date livrais
                    If line_1(1) = "E" Then
                        po_sheet.Cells(10, 6) = line_2(3).Substring(3, 2) & "/" & line_2(3).Substring(6, 2) & "/" & line_2(3).Substring(0, 2)
                    Else
                        po_sheet.Cells(10, 6) = line_2(3).Substring(6, 2) & "/" & line_2(3).Substring(3, 2) & "/" & line_2(3).Substring(0, 2)
                    End If
                    'Ship by
                    po_sheet.Cells(10, 7) = line_2(17).ToUpper
                    'FOB
                    po_sheet.Cells(10, 10) = line_2(13).ToUpper
                    'tx
                    po_sheet.Cells(9, 16) = line_2(19).ToUpper
                    po_sheet.Cells(10, 16) = line_2(20).ToUpper
                    '# fact
                    po_sheet.Cells(12, 1) = line_2(4).ToUpper
                    'Buyer
                    po_sheet.Cells(12, 5) = line_2(12).ToUpper
                    'Terms
                    po_sheet.Cells(12, 8) = line_2(5).ToUpper
                    'Freight
                    po_sheet.Cells(12, 11) = line_2(11).ToUpper
     
                    'Création des lignes de PO
                    For i = 4 To lines.GetUpperBound(0) - 1
                        line_x = Split(Replace(Replace(lines(i), Chr(34), ""), "'", " "), ";")
                        qty = qty + line_x(1)
                        'line
                        po_sheet.Cells(12 + i, 1) = line_x(0).ToUpper
                        'qte
                        po_sheet.Cells(12 + i, 2) = line_x(1).ToUpper
                        'vendor-item
                        If line_x(2) = "" Then
                            po_sheet.Cells(12 + i, 4) = line_x(4).ToUpper
                        Else
                            po_sheet.Cells(12 + i, 4) = line_x(2).ToUpper
                        End If
                        'desc
                        po_sheet.Cells(12 + i, 6) = line_x(3).ToUpper
                        'item-number
                        po_sheet.Cells(12 + i, 11) = "#PHV : " & line_x(4).ToUpper
                        'udm
                        po_sheet.Cells(12 + i, 15) = line_x(5).ToUpper
                        'prix
                        po_sheet.Cells(12 + i, 16) = CDec(line_x(6))
                        'amount
                        po_sheet.Cells(12 + i, 17) = CDec(line_x(7))
                    Next
                    po_sheet.Cells(12 + i + 1, 4) = line_x(10).ToUpper & line_x(11).ToUpper & line_x(12).ToUpper & line_x(13).ToUpper & line_x(14).ToUpper & line_x(15).ToUpper & line_x(16).ToUpper & line_x(17).ToUpper & line_x(18).ToUpper & line_x(19).ToUpper & line_x(20).ToUpper & line_x(21).ToUpper & line_x(22).ToUpper & line_x(23).ToUpper
                    po_sheet.Cells(12 + i + 3, 2) = "________"
                    po_sheet.Cells(12 + i + 3, 17) = "___________"
                    If line_1(1) = "E" Then
                        If line_2(15) = "USD" Then
                            po_sheet.Cells(12 + i + 3, 5) = "****** AMOUNTS SPECIFIED IN U.S.A CURRENCY ******"
                        Else
                            po_sheet.Cells(12 + i + 3, 5) = "******* AMOUNTS SPECIFIED IN CDN CURRENCY *******"
                        End If
                    Else
                        If line_2(15) = "USD" Then
                            po_sheet.Cells(12 + i + 3, 5) = "****** MONTANTS SPÉCIFIÉS EN DEVISE CDN ******"
                        Else
                            po_sheet.Cells(12 + i + 3, 5) = "****** MONTANTS SPÉCIFIÉS EN DEVISE USA ******"
                        End If
                    End If
                    po_sheet.Cells(12 + i + 4, 2) = qty
                    po_sheet.Cells(12 + i + 4, 16) = "TOTAL : "
                    po_sheet.Cells(12 + i + 4, 17) = CDec(line_2(16))
                    po_xl.DisplayAlerts = False
                    If line_0(0) = "@" Then
     
                        If File.Exists(f_out & "ma_" & line_0(1) & ".xls") Then
                            File.Delete(f_out & "ma_" & line_0(1) & ".xls")
                        End If
     
                        po_sheet.SaveAs(f_out & "ma_" & line_0(1) & ".xls")
                    Else
     
                        If File.Exists(f_out & "po_" & line_0(1) & ".xls") Then
                            File.Delete(f_out & "po_" & line_0(1) & ".xls")
                        End If
     
                        po_sheet.SaveAs(f_out & "po_" & line_0(1) & ".xls")
                    End If
     
                    po_xl.Quit()
                    po_sheet = Nothing
                    po_book = Nothing
                    po_xl = Nothing
     
                    'Kill du process excel
                    Dim Processes As Process() = Nothing
                    Processes = Process.GetProcessesByName("EXCEL")
                    ' Load ID Processes in Array
                    Dim intProcesses(Processes.GetUpperBound(0)) As Int16
                    Dim j As Int16
                    For j = 0 To Processes.GetUpperBound(0)
                        Process.GetProcessById(CInt(Processes(j).Id.ToString)).Kill()
                    Next
                    'Envoi du email si tel est le cas
                    If line_0(0) = "@" Then
                        fct_wait_sec(100000)
                        fct_send_mail(envoyeur, line_1(0), "Purchase Order/Commande d'Achat # " & line_0(1), 1, "<font face=arial size=2 color='black'>Purchase Order/Commande d'Achat # " & line_0(1) & "</font><br><br><img src='" & signature & "'><br><br><b><font face=arial size=2 color='#aaaaaa'>DISCLAIMER: </b><BR>This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail from your system.</font>", "ma_" & line_0(1))
                    End If
                End If
            Catch ex As Exception
                fct_send_mail(envoyeur, warning, "ERREUR PO VIA MAIL " & line_0(1), 0, ex.ToString, "none")
                '# erreur no 8
                fct_exec_sql("UPDATE pur_order SET err=8 WHERE pur_order.po_number='" & line_0(1) & "'")
            End Try
        End Sub
    j'espere m'ensortir parceke je suis vraiment bloque.
    Merci une autre fois

Discussions similaires

  1. Messages d'erreur sur install Runtime
    Par curt dans le forum Runtime
    Réponses: 6
    Dernier message: 30/11/2007, 23h41
  2. [Servlet] message d'erreur sur un OutputStream
    Par jehlg dans le forum Servlets/JSP
    Réponses: 5
    Dernier message: 05/04/2006, 17h03
  3. message d'erreur sur test module
    Par Daniel MOREAU dans le forum Access
    Réponses: 5
    Dernier message: 23/11/2005, 20h19
  4. message d'erreurs sur copie de fichier
    Par screeminelle dans le forum C++
    Réponses: 9
    Dernier message: 01/11/2005, 14h21
  5. [CR10] Pquoi absence du message d'erreur sur les Nulls ?
    Par speed034 dans le forum SAP Crystal Reports
    Réponses: 2
    Dernier message: 30/11/2004, 15h30

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