1

I've written a function that has to be called from a dll file. But I forgot to copy that dll file in the same folder

Now my excel file is giving me runtime error 438 that I can't stop. Clicking on "End" didn't stop it. "Debug" button is grayed out. CTRL+BREAK or ALT+ESC didn't stop it as it isn't actually infinite loop.

Copying the dll file also didn't stop it.

I can stop excel.exe But I've opened several other xlsx files that I didn't save yet. So stopping it would tamper all my work.

How can I stop this error so I can access the file?

BallGNM
  • 11
  • 3
  • It's written [here](https://stackoverflow.com/a/46359510/11827059) that double `Esc` may help. – ENIAC Jul 03 '22 at 08:44
  • It's not actual coding loop error. So all of those "breaking the cycle" didn't work here. My guess is that It just that dll function is called or checked again and again everytime I click "End" button. – BallGNM Jul 03 '22 at 09:13
  • Could you share the file? – ENIAC Jul 03 '22 at 10:19
  • I am afraid that it is not much to be done if `End` does not stop it. But you must learn from this and try preparing the working way to never face such a situation. You should always have `Option Explicit` on top of all modules (set that in VBE) and always declare a variable to keep the object you need to use. A good idea would be to also add a reference to it. When trying that, you will not find it in the location you think it should be. Then `Set` it. The compiler will worn before the code tries using it, even the dll has been deleted/renamed in the meantime, if the object could not be Set. – FaneDuru Jul 03 '22 at 10:26

0 Answers0