[Issue] Calc : disable "update links" when insert sheet

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

[Issue] Calc : disable "update links" when insert sheet

Post by Mr.Dandy »

Code: Select all

Sub Main
oDest = thiscomponent.Sheets(2)
ImportSheet("/home/LocalSync/foo.ods", "Sheet1", oDest)
End Sub

Sub ImportSheet(sDoc, sSheet, oSheet)
sURL = convertToURL(sDoc) 
oSheet.link(sURL, sSheet, "", "", com.sun.star.sheet.SheetLinkMode.NORMAL) 
oSheet.LinkMode = com.sun.star.sheet.SheetLinkMode.NONE 
oSheet.LinkURL = "" 
End sub
Since 4.1.4, insert sheet from another file displays a warning with an "Update links" prompt.
Is it possible to avoid it?
Last edited by Hagar Delest on Mon Jul 23, 2018 9:36 pm, edited 1 time in total.
Reason: tagged [Issue] (link to a bug report).
OpenOffice 4.1.12 - Windows 10
Bidouille
Volunteer
Posts: 574
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Calc : disable "update links" when insert sheet

Post by Bidouille »

Reported in https://bz.apache.org/ooo/show_bug.cgi?id=127582

Use com.sun.star.sheet.SheetLinkMode.VALUE is single way to have directly datas without warning.
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: [Issue] Calc : disable "update links" when insert sheet

Post by Mr.Dandy »

Thanks, fixed with you solution.
OpenOffice 4.1.12 - Windows 10
Post Reply