VB - Récupérer la mise à jour d'un blog
Résolu/Fermé
laguernette
Messages postés
6
Date d'inscription
lundi 27 février 2012
Statut
Membre
Dernière intervention
31 mars 2012
-
27 mars 2012 à 16:25
laguernette Messages postés 6 Date d'inscription lundi 27 février 2012 Statut Membre Dernière intervention 31 mars 2012 - 31 mars 2012 à 16:24
laguernette Messages postés 6 Date d'inscription lundi 27 février 2012 Statut Membre Dernière intervention 31 mars 2012 - 31 mars 2012 à 16:24
A voir également:
- VB - Récupérer la mise à jour d'un blog
- Mise a jour chrome - Accueil - Applications & Logiciels
- Mise a jour windows 10 - Accueil - Mise à jour
- Mise a jour chromecast - Accueil - Guide TV et vidéo
- Mise a jour kindle - Guide
- Comment recuperer un message supprimé sur whatsapp - Guide
2 réponses
PenguinFlash
Messages postés
158
Date d'inscription
mardi 30 août 2011
Statut
Membre
Dernière intervention
31 mars 2015
7
27 mars 2012 à 22:10
27 mars 2012 à 22:10
le form1.vb :
Imports System.Net.Mime.MediaTypeNames
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim appExcel As Application
Dim wbExcel As Excel.Worksheet
Dim wsExcel As Excel.Worksheet
Dim ValAChercher, ValARenvoyer
Dim c As Range
appExcel = CreateObject("Excel.Application")
wbExcel = appExcel.Workbooks.Open("http://autocyclettes.free.fr/")
wsExcel = wbExcel.Worksheets(1) 'wsExcel
ValAChercher = "Mise à jour :"
With wsExcel.Range("a1:a500")
c = .Find(ValAChercher)
If Not c Is Nothing Then
ValARenvoyer = c.Offset(0, 1).Value
TextBox1.Text = ValARenvoyer
End If
End With
End Sub
End Class
Le WorkSheet.vb:
Namespace Excel
Class Worksheet
Function Worksheets(p1 As Integer) As Worksheet
Throw New NotImplementedException
End Function
Function Range(p1 As String) As Object
Throw New NotImplementedException
End Function
End Class
End Namespace
Imports System.Net.Mime.MediaTypeNames
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim appExcel As Application
Dim wbExcel As Excel.Worksheet
Dim wsExcel As Excel.Worksheet
Dim ValAChercher, ValARenvoyer
Dim c As Range
appExcel = CreateObject("Excel.Application")
wbExcel = appExcel.Workbooks.Open("http://autocyclettes.free.fr/")
wsExcel = wbExcel.Worksheets(1) 'wsExcel
ValAChercher = "Mise à jour :"
With wsExcel.Range("a1:a500")
c = .Find(ValAChercher)
If Not c Is Nothing Then
ValARenvoyer = c.Offset(0, 1).Value
TextBox1.Text = ValARenvoyer
End If
End With
End Sub
End Class
Le WorkSheet.vb:
Namespace Excel
Class Worksheet
Function Worksheets(p1 As Integer) As Worksheet
Throw New NotImplementedException
End Function
Function Range(p1 As String) As Object
Throw New NotImplementedException
End Function
End Class
End Namespace
laguernette
Messages postés
6
Date d'inscription
lundi 27 février 2012
Statut
Membre
Dernière intervention
31 mars 2012
31 mars 2012 à 16:24
31 mars 2012 à 16:24
Merci, mais j'ai finalement opté pour la solution suivante :
Dim appExcel As Excel.Application 'Application Excel Dim wbExcel As Excel.Workbook 'Classeur Excel Dim wsExcel As Excel.Worksheet 'Feuille Excel 'Déclaration des variables appExcel = CreateObject("Excel.Application") 'Ouverture de l'application Excel wbExcel = appExcel.Workbooks.Open("http://autocyclettes.free.fr") 'Ouverture d'un fichier Excel wsExcel = wbExcel.Worksheets(1) 'wsExcel Dim Maj As Integer Dim Chr As Integer For Maj = 1 To 650 If InStr(wsExcel.Range("A" & Maj).Value, "Updated") <> 0 Then TextBox1.Text = "Le mot - Updated - existe dans la cellule A" & Maj TextBox2.Text = InStr(wsExcel.Range("A" & Maj).Value, "Updated") Chr = TextBox2.Text TextBox3.Text = Microsoft.VisualBasic.Mid(wsExcel.Range("A" & Maj).Value, Chr + 9, 8) End If Next Maj wbExcel.Close(False) '(referme la page Web) appExcel.Quit() 'Fermeture de l'application Excel wsExcel = Nothing 'Désallocation mémoire wbExcel = Nothing 'Désallocation mémoire appExcel = Nothing 'Désallocation mémoire