MODULE 1
Attribute VBA_ModuleType=VBAModule
Sub Module1
Option Explicit
Sub Copie_Fichier()
Dim WbSrce As Workbook, WbDest As Workbook, WbFile As Variant
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each WbFile In Workbooks
If WbFile.Name Like "www.GentleSource.com_File_Download_Script*" Or _
WbFile.Name Like "index_payant*" Then
Set WbSrce = WbFile
Set WbDest = ThisWorkbook
Exit For
End If
Next WbFile
If WbSrce Is Nothing Then
WbFile = Application.GetOpenFilename _
("Fichiers Excel (*.xlsx),*.xlsx", , "Sélectionnez le fichier :")
If VarType(WbFile) = vbBoolean Then
MsgBox "Action Annulé": Exit Sub
Else
Set WbSrce = Workbooks.Open(WbFile)
Set WbDest = ThisWorkbook
End If
End If
With WbDest.Sheets("PRONO")
.Cells.Delete
WbSrce.Sheets("Forme et Classe").Cells.Copy .Range("A1")
WbSrce.Close False
.Cells.UnMerge
.Columns("A:A").Insert
End With
Set WbSrce = Nothing
Set WbDest = Nothing
Sheets("Menu").Select
Range("A1").Select
MsgBox "Récupération Prono Terminé "
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
End Sub
MODULE 2
Attribute VBA_ModuleType=VBAModule
Sub Module2
Sub CButUpload_Click()
'Ancienne méthodeaccès au site WEB
'ActiveWorkbook.FollowHyperlink "http://trading-courses.ovh/main_root/logiciel/courses.php"
'
'Méthode maintenant utilisée
'http://trading-courses.ovh/main_root/download_center/index_payant.php?excel-24-11-2016.xlsx
Dim Wb As Workbook
Set Wb = ThisWorkbook
Workbooks.Open Filename:="http://trading-courses.ovh/main_root/download_center/index_payant.php?excel-" _
& Format(Now, "dd-mm-yyyy") & ".xlsx"
Wb.Activate
Set Wb = Nothing
MsgBox "FIN"
End Sub
End Sub