0

I have been running my VBA code on a different computer without flaw, then I get a new computer and when I try to run my code, it says the following "Compile error in hidden module: Sheet4". Then when I press "OK" it takes me to my code and highlights the first ".ComboBox1" part of the following code.

Private Sub ComboBox_Change()

End Sub
Sub SpinButton1_SpinUp()
If Me.ComboBox1.ListIndex = Me.ComboBox1.ListCount - 1 Then Exit Sub 
Me.ComboBox1.ListIndex = Me.ComboBox1.ListIndex+1
End Sub

FYI I am running a macro that calls SpinButton1_SpinUp. I haven't changed anything else about the code from the old computer to the new computer so now I don't know how to get rid of the error and be able to run my code properly. Thank you in advance.

braX
  • 11,506
  • 5
  • 20
  • 33
Hearno
  • 27
  • 6
  • https://stackoverflow.com/questions/68941139/recent-install-of-office365-came-with-excel-error-compile-error-in-hidden-modul#comment121839216_68941139? – GSerg Dec 21 '21 at 16:53
  • Sounds like a typical activex incompatibility caused by differing versions of the fm20.dll on each machine. Clear out any .exd and .box temp files and try again. – Rory Dec 21 '21 at 17:00
  • @GSerg after looking up PtrSafe, do I just need to add "Private Declare PtrSafe Function" before "Me.ComboBox1...." – Hearno Dec 21 '21 at 17:07
  • No, you most certainly don't. – GSerg Dec 21 '21 at 17:07
  • @Rory I cleared out the temp files and still nothing happened. Don't know what else to do. – Hearno Dec 21 '21 at 17:32
  • @GSerg is there anything else I can do to resolve this problem? – Hearno Dec 21 '21 at 17:38
  • Have you determined where it is coming from? Do you have malware? An addin? Are you using 64-bit Office? – GSerg Dec 21 '21 at 17:38
  • Sometimes it pops up random lines if you have missing libraries (references), have you cheked that ALL references are good to go? If there is one that is not on the OS should be stating MISSING on the VBA->Options -> References. Also if you're using a [date picker on the userform it does not exist on the 64bits version](https://stackoverflow.com/questions/58855359/is-there-a-way-to-use-a-datepicker-on-a-userform-in-excel-64bit-without-having-t) – Sgdva Dec 21 '21 at 18:50
  • @GSerg I have determined where it is coming, no I don't have malware, I am using 32 bit. Now I will configure my macro to this processing capability. Thank you – Hearno Dec 21 '21 at 20:02

0 Answers0