Bonjour,
J ai un probleme.

J aimerais ouvrir un fichier f2 a partir d une macro vba contenu dans f1. une fois que f2 est modifier, j aimerais le rendre visible et fermer f1. f1 et f2 sont tous des fichiers excel. j ai commence le code suivant, mais je suis un peu bloque:


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
 
Private Sub openFileUpdateAndMakeItVisible()
 
    Dim oExcel As Excel.Application
    Dim oWB As Workbook
    Set oExcel = New Excel.Application
 
    Dim destination_File As String
 
 
    'the file I want to update with the macro
    destination_Folder = "C:\Test\file2.xls"
 
    Set oWB = oExcel.Workbooks.Open(destination_File)
    oWB.Worksheets("Sheet1").Cells(1, 1) = "Hi"
    'oWB.Close
    'oExcel.Quit
    'Set oExcel = Nothing
 
End Sub
Merci d' avance pour votre aide