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

Keyboard macros or custom scripts

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

Postby Mr.Dandy » Fri Jul 20, 2018 9:54 am

Code: Select all   Expand viewCollapse view
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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm

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

Postby Bidouille » Mon Jul 23, 2018 11:01 am

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
Bidouille
Volunteer
 
Posts: 230
Joined: Mon Nov 19, 2007 10:58 am
Location: France

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

Postby Mr.Dandy » Mon Jul 30, 2018 4:14 pm

Thanks, fixed with you solution.
OpenOffice 4.1.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: Google [Bot] and 2 guests