Bonjour à tous,
comme indiqué dans le titre ci-dessus, je n'arrive pas à definer le problem auquel je suis confronté:
Voici mon code, il est censé parametrer l'importation de données depuis MS Excel 2010.
NB. Je ne suis pas trop confortable en VBA.
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
21
22
23
24
25 Private Sub cmdImportR_Click() On Error GoTo err_import MyFile = "\\soa-msb-fs\Rations Invoice & Budget\Database\Ration.xlsx" Set Mysh = MyFile.LaRequisition Set tb = [Commande Client] Call Importdata err_import: MsgBox Err.Description Resume Next End Sub Public Function Importdata(MyFile As Excel.Workbook, Mysh As Excel.Worksheet, tb As Table) On Error GoTo err_import 'Dim MyFile As New Excel.Application 'Dim tb As New Table 'Dim MaPlage As Excel.Range 'Set Mysh = MyFile.Worksheet DoCmd.TransferSpreadsheet acImport, , tb, MyFile.Mysh, True err_import: MsgBox Err.Description Resume Next End Function
Partager