We help IT Professionals succeed at work.
Get Started

VBA declare statements for Windows API calls showing red font (error)

Last Modified: 2020-02-11
I have some Windows API Declaration statements at the top of my VBA code module.  I've used the approach shown below to make them work for both 32 and 64 bit systems.  But since I upgraded my computer recently (using a 64-bit desktop), I notice that the 32 bit declare statements are now giving an error (showing up in red font in my code editor).  And anywhere in the code where I call the APIs is now giving me a compile error as well.

Anybody recognize what is going on and know how to fix this?

Declare statements
Watch Question
Test your restores, not your backups...
Expert of the Year 2019
Distinguished Expert 2020
This problem has been solved!
Unlock 1 Answer and 17 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE