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
Oliv'
* que je salut a écrit *:
Bonjour,
1/ Je voudrais ouvrir un fichier Excel existant 2/ Y ajouter un champs du message Oulook 3/ Fermer le fichier Excel en sauvegardant
J'ai trouvé ce code qui crée un nouveau fichier mais est'il possible d'ouvrir un fichier déjà existant
voici un exemple.
'Déclaration des variables Dim appExcel As Excel.Application 'Application Excel Dim wbExcel As Excel.Workbook 'Classeur Excel Dim wsExcel As Excel.Worksheet 'Feuille Excel
Set appExcel = CreateObject("Excel.Application") appExcel.Visible = true 'Ouverture d'un fichier Excel Set wbExcel = appExcel.Workbooks.Open(repertoire & objAtt.FileName) 'wsExcel correspond à la première feuille du fichier Set wsExcel = wbExcel.Worksheets(1)
'ici le code
' fin de la macro et fermeture de excel wbExcel.close appExcel.quit set appExcel = nothing Set wbExcel = nothing Set WsExcel =nothing
-- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Have a nice day Oliv' Pour me joindre : http://cerbermail.com/?V8r2o1YHl4 les sites références: Excel :http://www.excelabo.net http://xcell05.free.fr/ http://dj.joss.free.fr/ http://frederic.sigonneau.free.fr/ http://www.excel-vba-francais.com/ Word : http://faqword.free.fr/ Outlook : http://faq.outlook.free.fr/ les archives : http://groups.google.com/group/microsoft.public.fr.outlook OE6 : http://www.faqoe.com/ Sql : http://sqlpro.developpez.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*jpurtado@cpemail.com <jpurtado@cpemail.com> que je salut a écrit *:
Bonjour,
1/ Je voudrais ouvrir un fichier Excel existant
2/ Y ajouter un champs du message Oulook
3/ Fermer le fichier Excel en sauvegardant
J'ai trouvé ce code qui crée un nouveau fichier mais est'il possible
d'ouvrir un fichier déjà existant
voici un exemple.
'Déclaration des variables
Dim appExcel As Excel.Application 'Application Excel
Dim wbExcel As Excel.Workbook 'Classeur Excel
Dim wsExcel As Excel.Worksheet 'Feuille Excel
Set appExcel = CreateObject("Excel.Application")
appExcel.Visible = true
'Ouverture d'un fichier Excel
Set wbExcel = appExcel.Workbooks.Open(repertoire & objAtt.FileName)
'wsExcel correspond à la première feuille du fichier
Set wsExcel = wbExcel.Worksheets(1)
'ici le code
' fin de la macro et fermeture de excel
wbExcel.close
appExcel.quit
set appExcel = nothing
Set wbExcel = nothing
Set WsExcel =nothing
--
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have a nice day
Oliv'
Pour me joindre : http://cerbermail.com/?V8r2o1YHl4
les sites références:
Excel :http://www.excelabo.net http://xcell05.free.fr/
http://dj.joss.free.fr/
http://frederic.sigonneau.free.fr/ http://www.excel-vba-francais.com/
Word : http://faqword.free.fr/
Outlook : http://faq.outlook.free.fr/
les archives : http://groups.google.com/group/microsoft.public.fr.outlook
OE6 : http://www.faqoe.com/
Sql : http://sqlpro.developpez.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1/ Je voudrais ouvrir un fichier Excel existant 2/ Y ajouter un champs du message Oulook 3/ Fermer le fichier Excel en sauvegardant
J'ai trouvé ce code qui crée un nouveau fichier mais est'il possible d'ouvrir un fichier déjà existant
voici un exemple.
'Déclaration des variables Dim appExcel As Excel.Application 'Application Excel Dim wbExcel As Excel.Workbook 'Classeur Excel Dim wsExcel As Excel.Worksheet 'Feuille Excel
Set appExcel = CreateObject("Excel.Application") appExcel.Visible = true 'Ouverture d'un fichier Excel Set wbExcel = appExcel.Workbooks.Open(repertoire & objAtt.FileName) 'wsExcel correspond à la première feuille du fichier Set wsExcel = wbExcel.Worksheets(1)
'ici le code
' fin de la macro et fermeture de excel wbExcel.close appExcel.quit set appExcel = nothing Set wbExcel = nothing Set WsExcel =nothing
-- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Have a nice day Oliv' Pour me joindre : http://cerbermail.com/?V8r2o1YHl4 les sites références: Excel :http://www.excelabo.net http://xcell05.free.fr/ http://dj.joss.free.fr/ http://frederic.sigonneau.free.fr/ http://www.excel-vba-francais.com/ Word : http://faqword.free.fr/ Outlook : http://faq.outlook.free.fr/ les archives : http://groups.google.com/group/microsoft.public.fr.outlook OE6 : http://www.faqoe.com/ Sql : http://sqlpro.developpez.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~