ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   stupid cryptic messages (https://www.excelbanter.com/excel-programming/358272-stupid-cryptic-messages.html)

Jonathan Cooper

stupid cryptic messages
 
can someone explain to me why this isn't working and what the error message

compile error: Object required.

Sub tester()
Dim cntr As Integer
Set cntr = ActiveWorkbook.Names.Count

End Sub



Doug Glancy

stupid cryptic messages
 
Set is only used for objects, hence the message. Change to:

cntr = ActiveWorkbook.Names.Count

hth,

Doug

"Jonathan Cooper" wrote in
message ...
can someone explain to me why this isn't working and what the error
message

compile error: Object required.

Sub tester()
Dim cntr As Integer
Set cntr = ActiveWorkbook.Names.Count

End Sub






All times are GMT +1. The time now is 11:05 AM.

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