RDV+DIAL chat illimit� dans ta r�g!
no save
Assistance
Achat
News

Forum | programmation
[vb net] ouvrir fichier excel
balabonov, le mar. 04 juil. 2006 à 09:14:47
Bonjour à tous j'ai un problème pour ouvrr un fichier excellen vb.

Option Explicit On
Option Strict On

Imports Microsoft.Office.Interop.Excel.
Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Windows.Forms



Public Class FormMain
'Fonction ouvrir Fichier
Private Sub OuvrirFichier()

'Déclaration des variables
Dim xlsapp As Excel.Application 'Application Excel
Dim book As Excel.Workbook 'Classeur Excel

Try
'Nouvelle appliation excell
xlsapp = New Excel.Application
book = xlsapp.Workbooks.Open("chemin du fichier")
Catch ex As COMException
MessageBox.Show(ex.ToString())


End Try

End Sub

'Ouvrir le fichier après click sur Le menu.
Private Sub Men_Ouvrir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Men_Ouvrir.Click

OuvrirFichier()

End Sub

'Quitter l'application avec le menu.
Private Sub Men_Quitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Men_Quitter.Click

Me.Close()

End Sub

End Class

Et j'obtiens cette erreur:
System.Runtime.interopServices.COMExecution (0x80040154):Impossible de créer l'objet COM avec le CLSID '{00024500-0000-0000-C000-000000000046}'en raison de l'erreur suivante : classe non enregistrée

Que dois je faire?

J'utilise: visual studio 2005, j'ai excell 2003. et j'ai rajouté les références excell dans mon projet.


Cyrille
déc. 06
Suivant
REPONSES
Cyrille
déc. 06
Lupin.A
déc. 06
Nabil
mars 07
Malinots
juin 07
Belsteak
oct. 07
Amine
oct. 07
houssam-1
févr. 08
oxywahid
mars 08
redahs
avr. 08
Poupette
août 08
Version Web
Réalisé par RedShift
no save