J
justin martin
I am trying to import the rounding function from excel to
use as a function in queries. This is what I have, and it
is not working (numero = number to be rounded, numero1 =
number of desired digits):
Public Function round(numero As Variant, numero1 As
Variant)
Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.Application")
round = objExcel.WorksheetFunction.round(numero, numero1)
objExcel.Quit
Set objExcel = Nothing
End Function
Can someone tell me what I am doing wrong? Thanks!
justin
use as a function in queries. This is what I have, and it
is not working (numero = number to be rounded, numero1 =
number of desired digits):
Public Function round(numero As Variant, numero1 As
Variant)
Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.Application")
round = objExcel.WorksheetFunction.round(numero, numero1)
objExcel.Quit
Set objExcel = Nothing
End Function
Can someone tell me what I am doing wrong? Thanks!
justin