windows 10 VBA error

Sangbum Lee 1 Reputation point
2022-08-04T01:39:39.477+00:00

Hi,

I have an Excel file with VBA macro imbedded. It was working fine until I got new hp laptop.
Now I have this error:

227846-image.png

How do I fix this error?

Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 125.7K Reputation points
    2022-08-04T06:14:22.21+00:00

    Try adding PtrSafe:

    Private Declare PtrSafe Function AccessibleChildren Lib "oleacc.dll" _  
       (ByVal paccContainer As Office.IAccessible, ByVal iChildStart As Long, ByVal cChildren As Long, _  
        rgvarChildren As Variant, pcObtained As Long) _  
        As Long  
    

    Then check if it works.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.