Bug 102933 - MACRO: loadComponentFromURL fails
Summary: MACRO: loadComponentFromURL fails
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-03 14:24 UTC by Alex Kempshall
Modified: 2016-10-03 17:04 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Kempshall 2016-10-03 14:24:45 UTC
I've been running this code for a long long time without problems -

	oDoc = StarDesktop.loadComponentFromURL(sInURL, "MyFrame", 0, args0())

The line of code is contained in a macro which is called from a Button on a Base form. The purpose of the macro is to create a document  and then convert the document created to a pdf.

The aboove code now fails with a message box  that contains this text -

BASIC runtime error.
An exception occurred 
Type: com.sun.star.lang.IllegalArgumentException
Message: Unsupported URL <file:///home/alex/Documents/testoffice//BlueMerged0.odt>: "type detection failed".


The above code works quite happily in LO  5.1.5.2

This is the code in context


sub convertToPDF(strInFile AS String, strOutFile As String)
	writeToLogFile(time & " : " &"convertToPDF")
	
	Dim Dummy() 
	Dim sInUrl As String
	Dim sOutUrl As String
	Dim oDoc As Object
	dim dispatcher as object
	
	dim args0(0) as new com.sun.star.beans.PropertyValue
	args0(0).Name = "Hidden"
	args0(0).Value = True 
REM Remove full stops from name



	sInUrl = ConvertToURL(strInFile)
	oDoc = StarDesktop.loadComponentFromURL(sInURL, "MyFrame", 0, args0())
	
	sOutUrl = ConvertToURL(strOutFile)
	
	dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
	document = oDoc.CurrentController.Frame
Comment 1 Alex Kempshall 2016-10-03 17:03:46 UTC
It would appear that loadComponentFromURL is correctly telling me that me that the file "file:///home/alex/Documents/testoffice//BlueMerged0.odt" doesn't exist.

The reason for the non-existant file is some problem with mailmerge.