[Solved] How close document?

Java, C++, C#, Delphi, ??? - Using the UNO bridges

[Solved] How close document?

Postby hardegor » Mon Mar 16, 2015 10:42 pm

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   Expand viewCollapse view
   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
hardegor
 
Posts: 2
Joined: Mon Mar 16, 2015 10:30 pm

Re: How close document?

Postby FJCC » Mon Mar 16, 2015 10:55 pm

Call the close() method of your objCalc. See close.
Note that you have to set the parameter DeliverOwnership to either True or False.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7061
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How close document?

Postby hardegor » Mon Mar 16, 2015 11:10 pm

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
hardegor
 
Posts: 2
Joined: Mon Mar 16, 2015 10:30 pm

Re: [Solved] How close document?

Postby FJCC » Tue Mar 17, 2015 2:52 am

Use object inspection tools like MRI or XRay to find the methods and properties of any object.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7061
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA


Return to External Programs

Who is online

Users browsing this forum: No registered users and 1 guest