Error with Excel's Spreadsheet Compare: Cannot open files generated by write.xlsx() in R.

Wataru Kitagawa 0 Reputation points
2024-11-22T01:52:18.1+00:00

Using Office Professional Plus 2021, Excel's Spreadsheet Compare tool fails to open files when I attempt to compare two xlsx files. An error message below appears:
'Error opening workbook. Specified part does not exist in the package.'

This happens whenever I try to compare files generated by using a function write.xlsx() in a R package openxlsx. The files look perfectly fine when I open in Excel.

Could anyone possibly pinpoint the cause of this issue?

Microsoft 365 and Office Excel For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiajing Hua 18,060 Reputation points Moderator
    2024-11-22T08:57:09.0066667+00:00

    Hi @ Wataru Kitagawa

    Since your file is written by code, I can't do the test, thanks for your understanding.

    But based on my past experience, usually, if Excel file was generated by third-party tool or code which may generate quite limited XML scheme.

    Although, this XML scheme is enough to open the file in Excel, but not enough for some specified Excel features, such as Spreadsheet Compare.

    Here is a thread with the same error message: Specified part does not exist in the package.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.