Microsoft Visual Basic Compile error: Sub or Function not defined

Asked By 20 points N/A Posted on -
qa-featured

Hi Experts,

While running this macro I received an error message

Microsoft Visual Basic Compile error: Sub or Function not defined.

From the help option on the error message “Help” option I understand nothing.

Is there anybody who can help me giving clear concept of this error message?

Any suggestion would be appreciated.

Thanks in advance.

SHARE
Best Answer by Montelongo S Lockhart
Answered By 10 points N/A #134835

Microsoft Visual Basic Compile error: Sub or Function not defined

qa-featured

Hello David,

You will need to set a reference in your VBA project to Excel Link in order to resolve that issue:

  • Go to the Microsoft Visual Basic development window's project browser and click on your project.
  • And then go to the "Tools" menu and then  select "References"
  • After that check the "Excellink" box and then click "OK".

Regards,

Carl

 

Best Answer
Best Answer
Answered By 0 points N/A #134836

Microsoft Visual Basic Compile error: Sub or Function not defined

qa-featured

Hi David,

You are getting the error message “Sub or Function not defined”, perhaps in some part of your code, the sub or function is not declared. 

Another possible reason is due to that the name of the function is misspelled or you might have not been able to properly set up the procedure call.   

To fix this error you can do the following steps here.

Related Questions