Lỗi compile error in hidden module module 1 năm 2024

Microsoft Support found the root cause of this problem affecting Excel and Word on my Dad's PC. It was caused by a third-party add-in called 'Sapro Systems WinCalendar v4', though in your case it may be a different incompatible add-in. Fixing it was a matter of disabling the add-in. For Word, they disabled it by finding the Office startup folder and located the add-in file there - they moved the file out of that folder (which disables the add-in). Sorry, I can't remember the exact path of that folder, but it was under a c:\users\[Windows username]\ sub-folder. There would be an option in the Word front-end to access the Add-ins settings screen (similar to what I have described below for Excel).

For Excel, you should be able to access the add-ins as follows:

1. Launch MS Excel.

2. Create a new, blank worksheet (or open any worksheet).

3. In the middle of the title bar of the Excel window, there will be a search field containing the hint text: "Search". In that field, type "add-ins" (without the quotation marks) into that field and hit the 'Enter' key. This will display a menu of search results. In the search results, select 'Add-ins', which will be located under an 'Actions' sub-heading - this option will be shown with a 'cog' icon indicating that it is a settings/configuration option. That option will open the Add-ins dialog.

4. All add-ins will be listed in the Add-ins dialog. If any add-ins are active, then note what they are (so you can progressively enable them afterwards), untick the ticked check-boxes to disable them and click 'OK'.

5. Close and re-launch Excel.

If that fixes the problem, then the issue was caused by an incompatible add-in. If you had multiple add-ins enabled initially, then you can use an elimination method by re-activating one Add-in at a time to determine exactly which one caused the problem.

khi add-on excel bị lỗi vì lý do gì đó mỗi lần mở excel lên gặp câu thông báo compile error in hidden module ....

rất khó chịu với mỗi lần mở excel. cách giải quyết là vào đường dẫn bên dưới:

C:\Users\Tên User của bạn\AppData\Roaming\Microsoft\Excel\XLSTART

Xóa Add-on đó đi thì được. Hi vọng giải quyết được vấn đề của các bạn.

Khi mở 1 file excel có VBA, có thể bạn gặp phải thông báo lỗi compile error in hidden module. Vậy lỗi này do đâu mà có? Cách sửa lỗi này như thế nào? Hãy cùng Học Excel Online tìm hiểu qua bài viết này nhé.

Xem nhanh

Khi nào thì xảy ra lỗi compile error in hidden module?

Lỗi này thường xuất hiện với thông tin như sau:

Compile error in hidden module: ‘tên module‘. This error commonly occures when code is incompatible with the vesion, platform, or architecture of this application. Click “Help” for information on how to correct this error.

Nguyên nhân chủ yếu của lỗi này là do khi chúng ta đặt mật khẩu trong VBA, bất kỳ lỗi nào phát sinh trong VBA để xuất hiện dưới dạng thông báo lỗi compile error in hidden module.

Bởi vì khi đó VBA sẽ không xác định được cụ thể bên trong câu lệnh VBA của bạn có nội dung gì, lỗi chính xác ở vị trí nào. Do đó VBA chỉ báo lỗi chung chung như vậy.

Còn khi bạn không đặt mật khẩu trong VBA, bạn chỉ thấy xuất hiện lỗi dạng cho phép Debug, ví dụ như sau:

Khi bấm vào nút Debug, chúng ta sẽ đi tới chính xác vị trí lỗi trong cửa sổ VBA để có thể xem lại lỗi đó.

Cách khắc phục lỗi compile error in hidden module trong Excel VBA

Bởi nguyên nhân trên, chúng ta khắc phục lỗi này bằng cách: Hạn chế đặt mật khẩu trong VBA.

  • Chỉ đặt mật khẩu khi các lệnh VBA đã hoạt động chính xác, không có bất kỳ lỗi nào.
  • Nhớ mật khẩu đã đặt trong VBA để có thể mở ra khi gặp lỗi này; hoặc liên hệ với tác giả của file Excel chứa VBA để báo lỗi.

Khi bạn mở chế độ khóa bằng mật khẩu, VBA sẽ thay đổi cách báo lỗi khác, giúp bạn xác định được cụ thể lỗi ở đâu.

Khi bạn mới học VBA, bạn không nên khóa mã VBA bằng mật khẩu, bởi bạn khó lòng chắc chắn sẽ không có lỗi gì trong các lệnh VBA của mình. Ngoài ra người khác cũng khó giúp đỡ bạn được khi không biết chính xác lỗi xảy ra ở đâu.

Chủ đề