I’m trying to solve a problem with the following code but I just can’t find a way around it. Whenever I try the Macro, I get an error «Sub or Function not defined». and the debugger highlights in yellow «Sub Solver_Overtime() and highlights in blue «SolverRest»
I’m not certain what the problem is because it runs just fine on another computer.
Объект Sub или Function должны быть определены для вызываться. A Sub or Function must be defined in order to be called. Возможные причины этой ошибки: Possible causes of this error include:
Неправильное написание имени процедуры. Misspelling the procedure name.
Попытка вызова процедуры из другого проекта без явного добавления ссылки на этот проект в ссылки диалоговое окно. Trying to call a procedure from another project without explicitly adding a reference to that project in the References dialog box.
Задание процедуры, которая не отображается в вызывающую процедуру. Specifying a procedure that is not visible to the calling procedure.
Объявление процедуры библиотеки динамической компоновки (DLL) для Windows или Macintosh ресурс кода подпрограмму, которая не находится в указанный ресурс библиотеки или кода. Declaring a Windows dynamic-link library (DLL) routine or Macintosh code-resource routine that is not in the specified library or code resource.
Исправление ошибки To correct this error
Убедитесь, что имя процедуры указано правильно. Make sure that the procedure name is spelled correctly.
Найдите имя проекта, содержащего процедуру, которую требуется вызывать в ссылки диалоговое окно. Find the name of the project containing the procedure you want to call in the References dialog box. Если он не отображается, нажмите кнопку Обзор кнопку, чтобы найти его. If it does not appear, click the Browse button to search for it. Установите флажок слева от имени проекта и нажмите кнопку ОК. Select the check box to the left of the project name, and then click OK.
Проверьте имя процедуры. Check the name of the routine.
I am getting an error and I don’t know how to fix it.
What Sub or Function do I have to define here?
This code is highlighted yellow:


1 Answer 1
I would guess that you have not declared the function GetSystemMetrics . Ensure you have this line at the top of the routine:
If you have already declared this function, please include the relevant entire code in your post.