[Solved] How close document?

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
hardegor
Posts: 2
Joined: Mon Mar 16, 2015 10:30 pm

[Solved] How close document?

Post by hardegor »

I'm open document .xls, successfully read text and .... how close document?
Next, I need to open the next .xls, etc.

My code:

Code: Select all

	Dim args()	
	Set SM= CreateObject("com.sun.star.ServiceManager")	
	Set Desktop= SM.createInstance("com.sun.star.frame.Desktop")	
	currentfilename = "file:///T:/CD2.xls"
	Set objCalc= Desktop.loadComponentFromURL(currentfilename, "_blank", 0, args)
	Set objWorkSheet= objCalc.Sheets.getbyName("Sheet1")
	Set objCell= objWorkSheet.getCellbyPosition(0,3)
	Print objCell.getFormula()
Last edited by floris v on Mon Mar 16, 2015 11:45 pm, edited 2 times in total.
Reason: Added green checkmark for Solved
OpenOffice 3.1 on Windows XP
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How close document?

Post by FJCC »

Call the close() method of your objCalc. See close.
Note that you have to set the parameter DeliverOwnership to either True or False.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
hardegor
Posts: 2
Joined: Mon Mar 16, 2015 10:30 pm

Re: How close document?

Post by hardegor »

Ou, thanks! It's work! :=)
It is a pity that, the documentation for each object or method is not listed small snippets examples...
OpenOffice 3.1 on Windows XP
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: [Solved] How close document?

Post by FJCC »

Use object inspection tools like MRI or XRay to find the methods and properties of any object.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Post Reply