💾

Officeアップデートに伴う不具合対応方法 / Problem caused by Office updates

2025/7/8より実施されているOfficeアップデートにより、NMB実行時のエラーが発生している模様です。原因は、DLLファイルをカレントディレクトリから探さなくなったことです。対処法をお知らせします。

対処法1(非推奨。暫定。管理者権限必要)

1. C:\WINDOWS に MatrixCal64.dll をコピーしてください。

DLLはどのバージョンのものでも大丈夫です。

対処法2(推奨。やや高度。次のバージョンアップで正式対応。64bit版推奨)

1. NMB4.X.X.xlsmを開き、Alt+F11 で、VBAエディタを立ち上げてください。

2. 左側のペインから、標準モジュール → Main モジュールを開いてください。

3. 冒頭の Option Explicitの次の行に以下を追加して下さい。

64ビット版の場合、

Private Declare PtrSafe Function SetDllDirectory Lib "kernel32" Alias "SetDllDirectoryA" (ByVal lpPathName As String) As LongPtr

32ビット版の場合、

Private Declare Function SetDllDirectory Lib "kernel32" Alias "SetDllDirectoryA" (ByVal lpPathName As String) As Long

4.  検索で、"chdir"を探して、ChDir ThisWorkbook.Path の後に次の一行を追加してください。

SetDllDirectory ThisWorkbook.Path

5. NMB4.X.X.xlsmを保存してください。

これで、従来通りの動作となります。

  • --------------------------

Dear NMB users,

It seems that an error occurs when running NMB due to the Office update implemented on 7/8/2025.

The cause is that the DLL file is no longer searched for in the current directory. We will inform you of the solution.

Solution 1 (Not recommended. Temporary. Requires administrator privileges)

1. Copy MatrixCal64.dll to C:\WINDOWS.

Any version of DLL is fine.

Solution 2 (Recommended. Somewhat advanced. Will be officially supported in the next version upgrade. 64-bit version recommended)

1. Open NMB4.X.X.xlsm and press Alt + F11 to launch the VBA editor.

2. From the left pane, open Standard Modules → Main module.

3. Add the following to the line following "Option Explicit" at the beginning.

For 64-bit versions,

Private Declare PtrSafe Function SetDllDirectory Lib "kernel32" Alias "SetDllDirectoryA" (ByVal lpPathName As String) As LongPtr

For 32-bit versions,

Private Declare Function SetDllDirectory Lib "kernel32" Alias "SetDllDirectoryA" (ByVal lpPathName As String) As Long

4. Search for "chdir" and add the following line after "ChDir ThisWorkbook.Path".

SetDllDirectory ThisWorkbook.Path

5. Save NMB4.X.X.xlsm.

This will return to normal operation.