ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dget in VBA gets Object required run-time error? (https://www.excelbanter.com/excel-programming/285614-dget-vba-gets-object-required-run-time-error.html)

John MacGregor

Dget in VBA gets Object required run-time error?
 
This sheet function is ok:
DGET(ACDB, "TAS", $B$1:$B$2)
I can not get it to work in VBA:
Tas = Application.WorksheetFunction.DGet(ACDB, "TAS", Range("$B$1:$B$2").Value)
I get the Run-time error 424.
I have tried to explicitly specify the first and third parameter without any joy.

Tom Ogilvy

Dget in VBA gets Object required run-time error?
 
try removing Value

Tas = Application.WorksheetFunction.DGet(ACDB, "TAS", Range("$B$1:$B$2"))


--
Regards,
Tom Ogilvy

John MacGregor wrote in message
om...
This sheet function is ok:
DGET(ACDB, "TAS", $B$1:$B$2)
I can not get it to work in VBA:
Tas = Application.WorksheetFunction.DGet(ACDB, "TAS",

Range("$B$1:$B$2").Value)
I get the Run-time error 424.
I have tried to explicitly specify the first and third parameter without

any joy.




All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com