Bonjour,
J'aimerais savoir pourquoi l'ouverture du fichier excel pose probleme avec ce code fait sur Vb net.
J'ai besoin de votre aide SVP.
Cdlt
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 Option Strict Off Imports System.IO Imports System.Reflection ' For Missing.Value and BindingFlags Imports Excel = Microsoft.Office.Interop.Excel Module Resultat_Excel 'Friend WithEvents Ex As Excel.Application 'Friend WithEvents ThisDocument As Excel.Worksheets Public Sub Affichage_Resultats_Excel() Dim xl As New Excel.Application xl = New Excel.Application Dim msg1, msg2, msg3 As String If xl Is Nothing Then MsgBox("ERROR: EXCEL couldn't be started!") 'Environment.ExitCode = 0 Exit Sub End If xl.Visible = False 'affiche le document xl.Workbooks.Add() 'ajouter un nouveau classeur ==> Ligne de blocage du code If l_strFileName = "" Then xl.ActiveWorkbook.SaveAs("C:\NouveauClasseur") 'Enregistrer sous le classeur Else Dim toto As String = l_strFileName Call Lecture_chaine(toto) msg1 = "C:\" & toto xl.ActiveWorkbook.SaveAs(msg1) 'Enregistrer sous le classeur End If xl.ActiveWorkbook.Worksheets("Feuil1").Select() 'Selectionner une feuille xl.ActiveWorkbook.Worksheets("Feuil1").Name = "1" 'Renommer une feuille xl.ActiveWorkbook.Worksheets("1").Range("A1").Value = "Noeuds / Cas" xl.ActiveWorkbook.Worksheets("1").cells(1, 2).Value = "Fx" xl.ActiveWorkbook.Worksheets("1").Range("C1").Value = "Fy"
Partager