Skip to main content
Inspiring
January 16, 2025
Answered

Excel source sheet changes to first sheet when updating the link

  • January 16, 2025
  • 5 replies
  • 2133 views

Hello there,

 

I'm wondering if anyone knows solution to this problem. I imported any Excel sheet other than the first sheet from a multisheet Excel having the "create links when importing text or spreadsheet" preference on. Then I made some changes to the imported sheet in the Excel program. Updating the link changes the source sheet to the first Excel sheet. Is this a bug or am I missing something? Many thanks in advance!

Cheers!

Funtom

Correct answer Funtom

Problem solved. Since the Excel preferences set by a script are not saved anywhere during the automation process – or at least it seemed so looking the idml files –, manually updating links does the work with current InDesign Excel import setting. Of course in a server environment this is not a problem, but if a user runs an Excel-importing script and afterwards starts updating the links... enter ooops. I think I'll file a bug report here.

 

Thanks for all the replies!

Cheers

Funtom

5 replies

Robert at ID-Tasker
Legend
January 21, 2025

@Funtom 

 

Just in case ... are you sure that those files were saved from Excel?? Not Google Sheets or something else?

 

Can you share a sample spreadsheet? Please click my nickname if you prefer to do it privately.

 

FuntomAuthor
Inspiring
January 22, 2025

Positive. I created a new Excel file for the testing to make sure there is no problem with the file itself.

Robert at ID-Tasker
Legend
January 22, 2025
quote

I created a new Excel file for the testing to make sure there is no problem with the file itself.


By @Funtom

 

And? 

 

Or you mean before posting on the forum? 

 

Robert at ID-Tasker
Legend
January 21, 2025

@Funtom 

 

I've also checked linking to a whole sheet:

 

 

 

TOP - initial state - linking to the whole 2nd Sheet from my tool - red rectangle on the right.

 

BOTTOM - I've duplicated top TextFrame, edited linked XLSX file and then updated only this duplicated TextFrame - everything is as it should be.

 

(and also I've added new option to this linking rule - "Sheet Name" - which, of course, can work with other rules, that first populate NamedRegions from Excel file, so if there are references in the text to those named sheets / regions...)

 

Robert at ID-Tasker
Legend
January 21, 2025

@Funtom 

 

It works for me - including later update:

 

(this is a test so name of the XLSX file is hardcoded)

 

Unfortunately, problem is somewhere else - I can't set GeneralPreferences.CreateLinksOnContentPlace to TRUE from script ?!?! At lest in VB...

 

When set manually in the InDesign's UI - then it links Story to Excel file and when I update Excel file - it updates contents in InDesign perfectly fine - no change to first sheet.

 

Dave Creamer of IDEAS
Community Expert
Community Expert
January 21, 2025

@Robert at ID-Tasker Robert, when you say it works for you, are you referring a manual process or script-base process? It's already been established that the manual process works properly. 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Robert at ID-Tasker
Legend
January 21, 2025
quote

@Robert at ID-Tasker Robert, when you say it works for you, are you referring a manual process or script-base process? It's already been established that the manual process works properly. 


By @Dave Creamer of IDEAS

 

As per screenshot, script-based process - I'm linking to the NamedRegion using my tool - no manual steps involved - beside setting manually to TRUE first:

 

 

 

FuntomAuthorCorrect answer
Inspiring
January 17, 2025

Problem solved. Since the Excel preferences set by a script are not saved anywhere during the automation process – or at least it seemed so looking the idml files –, manually updating links does the work with current InDesign Excel import setting. Of course in a server environment this is not a problem, but if a user runs an Excel-importing script and afterwards starts updating the links... enter ooops. I think I'll file a bug report here.

 

Thanks for all the replies!

Cheers

Funtom

Dave Creamer of IDEAS
Community Expert
Community Expert
January 17, 2025

RE: ...file a bug report...

Where are you planning to file the bug report? If I'm understanding it correctly, it sounds like a script issue. Is this script a third-party script or a "home grown" script?

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Robert at ID-Tasker
Legend
January 17, 2025
quote

RE: ...file a bug report...

Where are you planning to file the bug report? If I'm understanding it correctly, it sounds like a script issue. Is this script a third-party script or a "home grown" script?

 

By @Dave Creamer of IDEAS

 

It's not a script issue - someone forgot to "make available" info about which sheet from the XLS file has been linked and which area / NamedRegion. 

 

Robert at ID-Tasker
Legend
January 16, 2025

Can you share a sample INDD + Excel files?

 

FuntomAuthor
Inspiring
January 16, 2025

Hello Robert,

The files are new test files, Macintosh Sonoma 14.7.2, InDesign version 20.0.1. I've discovered that the problem is caused by an InDesign script placing the Excel. And yes, the subforum should be "Scripting".

 

FuntomAuthor
Inspiring
January 16, 2025

This is a process designed to be used in an InDesign Server environment. Simple workaround is to import – not update – the sheets every time the source Excel has changed.