Microsoft Access
--
Questions
--
Followers
Top Experts

i'm trying to delete all the named ranges in excel
Sub test()
Dim x As Integer
x = 1
Application.DisplayAlerts = False
On Error Resume Next
For x = 1 To 100
ActiveWorkbook.Names(x).De
Next
Application.DisplayAlerts = True
End Sub
i tried do until err<>0 but the same problem still happens - once it hits an invalid reference it stops. thanks guys!!
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
DoCmd.SetWarnings False
refer
http://www.mrexcel.com/forum/microsoft-access/89057-can-you-supress-display-alerts-via-visual-basic-applications.html
Instead of using 100 as an upper limit, use the number of worksheets.
Application.worksheets.cou






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I'm not an Excel expert, but does this get the total count?
ActiveWorkbook.names.count
pratima thanks for looking into this but i think docmd is for Access not Excel, i tried it in Excel and it couldn't work - not found in the object library. but thanks! = )
...In my case, I only posted a very basic example of a generic error handler.
In other words, ...any expert here could have posted the same thing...
(No research needed)
My post did nothing to actually "answer" your question, it was just extra info.
In the end, and to be honest, ...I have done well this year "point-wise", so I saw no reason to appear greedy for a simple post like that.
So AFAICT, you can still request that my post be removed from the points split.
..."There will always be another Question"
;-)
Jeff

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
;-)
Jeff






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Microsoft Access
--
Questions
--
Followers
Top Experts
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.