VBA Access execution problem of a button
darkspoilt
Posted messages
76
Registration date
Status
Member
Last intervention
-
sncf Posted messages 122 Status Member -
sncf Posted messages 122 Status Member -
Hello,
I created a temporary code to test my function on click when filling out a form
and it has an error when I click the button it writes to me
"The expression on click entered as a parameter for the event type property is causing a defined user type error.
The result of the expression is not the name of a macro, the name of a user-defined function, or [Event procedure]
An error may have occurred while evaluating a function, an event, or a macro."
My button is configured for event procedure
If someone sees the error, I thank them in advance
I created a temporary code to test my function on click when filling out a form
and it has an error when I click the button it writes to me
"The expression on click entered as a parameter for the event type property is causing a defined user type error.
The result of the expression is not the name of a macro, the name of a user-defined function, or [Event procedure]
An error may have occurred while evaluating a function, an event, or a macro."
My button is configured for event procedure
If someone sees the error, I thank them in advance
Sub Commande0_Click() Dim l As Integer l = Ligne() DoCmd.TransferSpreadsheet acImport, , CA, "D:\Eric\dossier_projets\TDB\Chiffres-Affaires\a-Activité paiement porteurs CA an2007.xls", 0, "K" & i End Sub Public Function Ligne() As Integer Public AppExcel As Excel.Application Private wbFile As Excel.Workbook Public i As Integer Set AppExcel = CreateObject("Excel.Application") ' Opening excel If Not AppExcel Is Nothing Then Set wbFile = AppExcel.Workbooks.Open("c:\toto.xls", False, True) 'Opening the workbook If Not wbFile Is Nothing Then Do While Cells(i, 1).Text <> "TOTAL" i = i + 1 Loop wbFile.Close AppExcel.Application.Quit Set AppExcel = Nothing End If End If End Function Configuration: Windows XP Internet Explorer 6.0
6 answers
Merci maintenant j'ai un problème avec mon
DoCmd.TransferSpreadsheet acImport, , "CA", Chiffre, 0, "K" & i
Good evening
In your sub, what is the i?
--
Pascal
How complicated it is when we search, how simple it is when we have found it
In your sub, what is the i?
--
Pascal
How complicated it is when we search, how simple it is when we have found it