Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
LSteph
Bonjour,
Dans Visual Basic Editor ce qui est ouvert
est normalement sur ta gauche, dans l'explorateur de projet.
En VBA tu peux récupèrer les nom correspondants
'selon leur dll
Sub listOdll() Dim i As Byte, msg As String With Application.VBE.VBProjects For i = 1 To .Count msg = msg & .Item(i).BuildFileName & vbCrLf Next End With MsgBox msg End Sub
'ou leur nom VBA, pas celui qui est entre parenthèse
Sub listOp() Dim i As Byte, msg As String With Application.VBE.VBProjects For i = 1 To .Count msg = msg & .Item(i).Name & vbCrLf Next End With MsgBox msg End Sub
'note que tu aura aussi les .xls
'Cordialement. '__ 'lSteph
Bonjour,
Dans Visual Basic Editor ce qui est ouvert
est normalement sur ta gauche, dans l'explorateur de projet.
En VBA tu peux récupèrer les nom correspondants
'selon leur dll
Sub listOdll()
Dim i As Byte, msg As String
With Application.VBE.VBProjects
For i = 1 To .Count
msg = msg & .Item(i).BuildFileName & vbCrLf
Next
End With
MsgBox msg
End Sub
'ou leur nom VBA, pas celui qui est entre parenthèse
Sub listOp()
Dim i As Byte, msg As String
With Application.VBE.VBProjects
For i = 1 To .Count
msg = msg & .Item(i).Name & vbCrLf
Next
End With
MsgBox msg
End Sub
est normalement sur ta gauche, dans l'explorateur de projet.
En VBA tu peux récupèrer les nom correspondants
'selon leur dll
Sub listOdll() Dim i As Byte, msg As String With Application.VBE.VBProjects For i = 1 To .Count msg = msg & .Item(i).BuildFileName & vbCrLf Next End With MsgBox msg End Sub
'ou leur nom VBA, pas celui qui est entre parenthèse
Sub listOp() Dim i As Byte, msg As String With Application.VBE.VBProjects For i = 1 To .Count msg = msg & .Item(i).Name & vbCrLf Next End With MsgBox msg End Sub
'note que tu aura aussi les .xls
'Cordialement. '__ 'lSteph
Frédéric Sigonneau
Un fichier xla est, depuis Excel 97, un classeur comme un autre. S'il est ouvert, il fait partie des items de la collection Workbooks. Ce genre de code (solution parmi d'autres) permet de savoir si c'est le cas ou non :
'================= Sub test() Dim Nom As String Nom = "BoPliablev2.xla" MsgBox IsOuvert(Nom) End Sub
Function IsOuvert(NomXla) Dim Xla As Workbook On Error Resume Next Set Xla = Workbooks(NomXla) On Error GoTo 0 IsOuvert = Not (Xla Is Nothing) End Function '================= FS --- Frédéric Sigonneau http://frederic.sigonneau.free.fr
Bonjour,
En VBA, comment puis-je savoir si un fichier ".xla" est déjà ouvert ?
Merci pour votre aide.
Un fichier xla est, depuis Excel 97, un classeur comme un autre. S'il est
ouvert, il fait partie des items de la collection Workbooks.
Ce genre de code (solution parmi d'autres) permet de savoir si c'est le cas ou non :
'================= Sub test()
Dim Nom As String
Nom = "BoPliablev2.xla"
MsgBox IsOuvert(Nom)
End Sub
Function IsOuvert(NomXla)
Dim Xla As Workbook
On Error Resume Next
Set Xla = Workbooks(NomXla)
On Error GoTo 0
IsOuvert = Not (Xla Is Nothing)
End Function
'=================
FS
---
Frédéric Sigonneau
http://frederic.sigonneau.free.fr
Bonjour,
En VBA, comment puis-je savoir si un fichier ".xla" est déjà ouvert ?
Un fichier xla est, depuis Excel 97, un classeur comme un autre. S'il est ouvert, il fait partie des items de la collection Workbooks. Ce genre de code (solution parmi d'autres) permet de savoir si c'est le cas ou non :
'================= Sub test() Dim Nom As String Nom = "BoPliablev2.xla" MsgBox IsOuvert(Nom) End Sub
Function IsOuvert(NomXla) Dim Xla As Workbook On Error Resume Next Set Xla = Workbooks(NomXla) On Error GoTo 0 IsOuvert = Not (Xla Is Nothing) End Function '================= FS --- Frédéric Sigonneau http://frederic.sigonneau.free.fr
Bonjour,
En VBA, comment puis-je savoir si un fichier ".xla" est déjà ouvert ?
Merci pour votre aide.
Patrick
Merci.
-- Patrick
"Frédéric Sigonneau" wrote:
Un fichier xla est, depuis Excel 97, un classeur comme un autre. S'il est ouvert, il fait partie des items de la collection Workbooks. Ce genre de code (solution parmi d'autres) permet de savoir si c'est le cas ou non :
'================= > Sub test() Dim Nom As String Nom = "BoPliablev2.xla" MsgBox IsOuvert(Nom) End Sub
Function IsOuvert(NomXla) Dim Xla As Workbook On Error Resume Next Set Xla = Workbooks(NomXla) On Error GoTo 0 IsOuvert = Not (Xla Is Nothing) End Function '================= > FS --- Frédéric Sigonneau http://frederic.sigonneau.free.fr
Bonjour,
En VBA, comment puis-je savoir si un fichier ".xla" est déjà ouvert ?
Merci pour votre aide.
Merci.
--
Patrick
"Frédéric Sigonneau" wrote:
Un fichier xla est, depuis Excel 97, un classeur comme un autre. S'il est
ouvert, il fait partie des items de la collection Workbooks.
Ce genre de code (solution parmi d'autres) permet de savoir si c'est le cas ou non :
'================= > Sub test()
Dim Nom As String
Nom = "BoPliablev2.xla"
MsgBox IsOuvert(Nom)
End Sub
Function IsOuvert(NomXla)
Dim Xla As Workbook
On Error Resume Next
Set Xla = Workbooks(NomXla)
On Error GoTo 0
IsOuvert = Not (Xla Is Nothing)
End Function
'================= >
FS
---
Frédéric Sigonneau
http://frederic.sigonneau.free.fr
Bonjour,
En VBA, comment puis-je savoir si un fichier ".xla" est déjà ouvert ?
Un fichier xla est, depuis Excel 97, un classeur comme un autre. S'il est ouvert, il fait partie des items de la collection Workbooks. Ce genre de code (solution parmi d'autres) permet de savoir si c'est le cas ou non :
'================= > Sub test() Dim Nom As String Nom = "BoPliablev2.xla" MsgBox IsOuvert(Nom) End Sub
Function IsOuvert(NomXla) Dim Xla As Workbook On Error Resume Next Set Xla = Workbooks(NomXla) On Error GoTo 0 IsOuvert = Not (Xla Is Nothing) End Function '================= > FS --- Frédéric Sigonneau http://frederic.sigonneau.free.fr
Bonjour,
En VBA, comment puis-je savoir si un fichier ".xla" est déjà ouvert ?