Office 365 Excel - Microsoft Visual Basic for Applications - Compile Error

Anonymous
2020-09-29T11:53:33+00:00

Hi,

I have a problem with an Excel file which we have on our server. Every time I try to open it on this specific computer on this file I'll get this error:

Compile error:

The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and and then mark them with the PtrSafe attribute.

But the problem is that no one have this problem on their computers in our company just specifically this one PC, but before some update or something ( ( I don't know what exactly happened) it perfectly worked on this computer too. And all of us uses the same computers (Lenovo T480s laptops and Lenovo M720q desktops) with an preinstalled Windows 10 Enterprise 64-bit versions and Office 365. I don't really want to change the code in this Excel because as I said it is working fine on the other dozens of our PCs.

Thank you for you help.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Anonymous
    2020-09-29T15:19:27+00:00

    Hi NorbertU,

    Thanks for posting your query in this community. Based on your description, you received the above error when you open an Excel file with VBA in company server. And this is only occurred to this specific computer in your company.

    To further narrow down this problem, may I know the following information at your convenience?

    1: What is Office application’ s product information, version, update channel in this computer? You can go to File > Account > Product Information to find details and share a screenshot of “Product information” page with us.

    2: If you download the file to the local disk, does the same scenario occur when you open it?

    3: You can also try to create a new file with the same VBA and see whether the same scenario occurred when you open it. This can also isolate whether the problem is related to the local environment of the computer.

    Based on this error message, generally this error requires Declare Statements to include PtrSafe keyword when it is running in 64-bit version.

    For your information:

    The code in this project must be updated for use on 64-bit systems

    Since the problem is only occurred in this particular computer, I suggest you can compare this computer environment with other computers’ environments in your company,  check this computer has installed the same Windows system version and its architecture, Office version and its architecture (64 bit or 32 bit) are same with the other computers without any issue.

    Best regards,

    Dihao

    0 comments No comments
  2. Anonymous
    2020-10-01T13:37:26+00:00

    Hi Dihao,

    Thank you for your answer.

    1. The version of Office on that computer is actually the same as on the other out computers.

    1. Yes, I have tried to download the file to a local disk, but the same thing happened. See below in the picture.

    1. I've find out that this PC is running the 1709 version of Windows 10 E. but the others have the 1809 version. Also this thing happened to me a while back with a different Excel VBA file, on another computer, but now I checked and it was also running on the 1709 version. I've couldn't do anything else than change it for an another PC, because I don't have administrator rights to update the version of Windows. But I still wondering if it is because of this, why the files worked fine before on the same computer and they don't work now. 

    Thank you,

    Best regards,

    Norbert

    0 comments No comments
  3. Anonymous
    2020-10-01T15:54:25+00:00

    Hi Norbert,

    Thank you for your reply and updates.  

    In this scenario, the problem could be either related to Windows OS or the VBA code itself since the other computers have the same Office version as this one. However, it is recommended you can update Office application to the latest version, as I noticed that your Office version is quite old for Semi-Annual Enterprise Channel. Some time, some unexpected behaviors could be related to the old office version.

    For your information:

    Update history for Microsoft 365 Apps

    In addition, I suggest you can try out the following methods and see whether you can run the code correctly on this computer.

    1: I understand you may not prefer to modify the code since the other computers can run it correctly. But according this this article about Declare statement, it is required user to include PtrSafe in Declare statement. Hence, I suggest you can add PtrSafe into Declare statement for a local file copy for testing purpose and see the results.

     

    2: As the problem could also be related to Windows OS, hence, I recommend you can let the IT admin in your company to update this computer to 1809 version as well and see whether the same scenario occurred.

    Best regards,

    Dihao

    0 comments No comments
  4. Anonymous
    2020-10-03T16:57:34+00:00

    Hi Norbert, 

    Regarding to this question. is there any update? If so, please feel free to post back  here and share with us.

    Best regards,

    Dihao

    0 comments No comments
  5. Anonymous
    2020-10-05T06:22:28+00:00

    HI,

    It is a little bit of a complicated process here at us, but I will let you know if there will be any update to this problem.

    Best regards,

    Norbert

    0 comments No comments