Forum Discussion

Arvind Kaushik's avatar
Arvind Kaushik
Copper Contributor
Feb 17, 2017

VBA Excel Code Compatible Error

Hi,

 

I am facing the below mentioned error, The VBA code run perfectly in my system, While using the same macro to another system it shows the below mentioned error:

 

"The error commonly occurs when code is incompatible with the version, platform, or architecture of this application."

 

I am really very frustrated with this error.

 

Even Simple VBA code also prodcuced error e.g. I simple use Command button on the sheet and use Msgbox "Hi".

Now the probelm is that This  works fine in my system. But when I send this workbook to someone else in my team then it shows the above mentioned error.

 

I have tried following in the users system:-

 

1. Delete *.EXD files in the user's temp folder

2. re-install excel and  windows,  the same platform I have.

 

I have developed N numbers of VBA automations but at some workstations my code procuded the above mentioned error and at some workstations it workes fine.

 

Can anyone resolve this problem?  

 

Regards,

Arvind Kaushik

7 Replies

  • Chip Pearson's avatar
    Chip Pearson
    Copper Contributor
    A few quick checks. In VBA, go to the Tools menu, choose References, and make sure none are marked MISSING. Make sure you are not mixing 32-bit libraries with 64-bit libraries. If you're running Excel 32-bit and you try to load a 64-bit add-in, I'm not sure what will happen, I've never tried it, but it doesn't seem like a good idea. As you do a lot of editing, a great deal of internal trash code accumulates inside VBA's storage areas, and this can cause extremely bizarre problems. The solution is to export (use Export, not copy/paste) all VBA out to text files, purge all existing VBA, and then import the text files (use Import, not copy/paste). Or, just download Rob Bovey's CodeCleaner add-in from appspro.com and it will do all that in one click of the mouse. Are all the machines in question running 32-bit or 64-bit Excel, or is it a mix? If your code or code in a referenced libary is 64-bit and you're on 32-bit, you would likely see this error or get "undefined type" errors. Are they all Office 2015 or are they a mix. You might have to look at each reference on a problematic machine, get the file name, and compare the files on working and non-working machines. E.g, ensure build numbers and dates are the same, that sort of thing.
  • Arvind Kaushik's avatar
    Arvind Kaushik
    Copper Contributor

    Hi,

     

    I am attaching the Error Screenshot...

    Regards,

    Arvind Kaushik

    • IngeborgHawighorst's avatar
      IngeborgHawighorst
      MVP

      What suggestions do you get when you click the Help button in that error message?

       

      What happens if you step through the code on the other person's machine?

       

      What is your OS and Excel version exactly?

      What is the other person's OS and Excel version exactly? Don't just say "the same". Detail it. 

      • Arvind Kaushik's avatar
        Arvind Kaushik
        Copper Contributor

        Hi,

         

        F8 Key (next step) shows:

         

        We all are using the Windows 8 and ms office 2013 version

         

         

         

         Regards,

        Arvind

Resources