Hi @HR,
Thank you for reaching out to the Microsoft Q&A forum and sharing the details of your experience with Visio. I understand how important it is to maintain a smooth workflow, and I appreciate your patience as we work through this together.
Based on your description and the error message “Unexpected end of file” you encountered when attempting to refresh the data, it appears that Visio is having trouble processing the original data source link. This can sometimes happen due to internal inconsistencies in how the data connection is stored.
To better assist you, could you please help us with a few additional details?
- Which version of Visio are you currently using? (e.g., Visio 2019, Visio for Microsoft 365)
- Is your Visio file stored locally or on a cloud service (e.g., OneDrive, SharePoint)?
- Is the Excel workbook stored in the same location as the Visio file?
- Are you using a table or named range in Excel for the data link?
These details will help us tailor the solution to your specific environment.
In the meantime, please follow some workarounds that you can try:
1/ Try to relink the original Data Source
This step helps reset the connection and may allow you to remove it afterward.
- Open your Visio file.
- Click on the Data Visualizer diagram container.
- Go to the Data Tools Design tab.
- Select Relink Source Data.
- Choose the same Excel workbook and table/range.
- After relinking, try removing the data source again.
2/ You can clean up shape data (Optional but Recommended)
If Visio retains old fields from the previous link, this step helps reset them.
- Insert a new shape (e.g., Manager) from a blank Org Chart.
- Copy this shape into your existing diagram.
- Open the Shape Data Window.
- Right-click below the fields and choose Shape Data Sets > Add.
- Create a new set based on the clean shape and apply it to the affected shapes.
3/ Then try to refresh the Data Source
To ensure the connection is working properly:
- Open the Visio file in the desktop app.
- Select the diagram container.
- Go to Data Tools Design > Update Source Data.
- If prompted, relink the source first.
- Save and close both Excel and Visio files.
- Reopen Excel and click Refresh in the diagram area.
For your information that you can concern:
- The error message “Unexpected end of file” may indicate that Visio is unable to read the full structure of the linked Excel file. Since you confirmed the file works fine when added as a second source, this suggests the issue is isolated to the first link.
- If the issue persists, consider creating a new diagram using the same Excel file to bypass the corrupted link.
Note: Please understand that our initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution. I hope the information provided proves useful. Please proceed with the outlined steps and let me know whether they resolve the issue. If not, I’ll be glad to continue working with you to find a solution.
Thank you for your patience and understanding throughout this process. Should you have any questions or need further assistance, feel free to reach out at any time.
I look forward to hearing from you.
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.