Jump to content

Search the Community

Showing results for tags 'vba error key not found'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. Robert Random

    VBA Key Not Found Error

    Hi. I pasted the following code from a help file, into a new .dvb file and ran it. I used to work fine. Currently it gives me an error (shown below). It used to work fine previously. I reinstalled ACAD and the VBA enabler. Still same. Not sure what to do. Thanks in advance for any helpful advice. ~Robert Sub RemoveMyLayer() On Error Resume Next '' Get the layer "MyLayer" from the Layers collection Dim ABCLayer As AcadLayer Set ABCLayer = ThisDrawing.Layers.Item("MyLayer") '' Check for an error, if no error occurs the layer exists If Err = 0 Then '' Delete the layer ABCLayer.Delete '' Clear the current error Err.Clear '' Get the layer again if it is found the layer could not be removed Set ABCLayer = ThisDrawing.Layers.Item("MyLayer") '' Check for error, if an error is encountered the layer was removed If Err <> 0 Then ThisDrawing.Utility.prompt "'MyLayer' was removed" Else ThisDrawing.Utility.prompt "'MyLayer' could not be removed" End If Else ThisDrawing.Utility.prompt "'MyLayer' does not exist" End If End Sub
×
×
  • Create New...