Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Problems with OfficeAutomation (Solved) (old application ok but new comply application fail when AddSheet())
Problems with OfficeAutomation (Solved) [message #44007] Thu, 11 December 2014 13:54 Go to next message
pfsdanny is currently offline  pfsdanny
Messages: 26
Registered: December 2011
Location: Hong Kong
Promising Member
TheIde: #5485
Windows 7 32 bit Service Pack 1
Builder GCC (MinGW) 4.8.1

OfficeSheet sheet;
sheet.Init("Open");
if (!sheet.OpenSheet("test.ods", true) sheet.AddSheet("test", true); <<= the AddSheet() return false

I have an old application using the above syntax works ok, but the new application failed. I have try to comply the OfficeAutomation_demo_console from the bazaar and get the same result (fail to AddSheet()). I try to copy the OfficatAutomation.a, OfficatAutomatic.o, OfficeDoc.o and OfficeSheet.o from my old application output folder to the new application output folder, touch the files date time and comply the OfficeAutomation_demo_console again, this time it works.

It seems the newly comply OfficeAutomation files is not working. Does anyone has similar problems. Does the Windows 7 update cause the problem?

Thanks.

[Updated on: Fri, 12 December 2014 15:22]

Report message to a moderator

Re: Problems with OfficeAutomation [message #44009 is a reply to message #44007] Thu, 11 December 2014 21:08 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello pfsdanny

Code is updated. I hope the problem is solved.

UNO automation interface is a mess, and LibreOffice team seems to change it a little bit every X time...


Best regards
Iñaki
Re: Problems with OfficeAutomation [message #44011 is a reply to message #44009] Fri, 12 December 2014 08:40 Go to previous messageGo to next message
pfsdanny is currently offline  pfsdanny
Messages: 26
Registered: December 2011
Location: Hong Kong
Promising Member
Thanks, will downloading #7962 and try it.
Re: Problems with OfficeAutomation [message #44012 is a reply to message #44011] Fri, 12 December 2014 09:39 Go to previous messageGo to next message
pfsdanny is currently offline  pfsdanny
Messages: 26
Registered: December 2011
Location: Hong Kong
Promising Member
It works with exporting to worksheet. However, it can't close the worksheet with the Quit() method and OpenOffice popup a windows says
'Owner instance already closed. Call was rejected'.
Also, the complied OfficeAutomation_demo_console has the same issue, when reach the sheet.Quit(), the worksheet doe not close and the DocTest cannot open the Writer for testing. It seems that the Quit() function still has some problems.

Re: Problems with OfficeAutomation [message #44013 is a reply to message #44012] Fri, 12 December 2014 13:34 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello pfsdanny

Thank you for your test. Please comment this line in OfficeAutomation.cpp and try it:

bool OPENSheet::Quit() {
	if (!quit) {
		quit = true;
		if (Desktop) {
			//Ole::Method(Desktop, "Dispose"); PLEASE COMMENT THIS LINE
			return Ole::Method(Desktop, "Terminate");
		}
	}
	return true;
}


Best regards
Iñaki
Re: Problems with OfficeAutomation [message #44014 is a reply to message #44013] Fri, 12 December 2014 15:21 Go to previous messageGo to next message
pfsdanny is currently offline  pfsdanny
Messages: 26
Registered: December 2011
Location: Hong Kong
Promising Member
Dear Koldo,

Thanks, it works great. OfficeAutomation is a must for me, many many thanks. Have a nice day.

Danny
Re: Problems with OfficeAutomation [message #44017 is a reply to message #44014] Fri, 12 December 2014 22:41 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Smile

Best regards
Iñaki
Previous Topic: problem with sysinfo
Next Topic: Linux "start" equivalent
Goto Forum:
  


Current Time: Fri Mar 29 09:47:51 CET 2024

Total time taken to generate the page: 0.01183 seconds