Talk:Documentation/BASIC Guide/Structure of Spreadsheets

From Apache OpenOffice Wiki
< Talk:Documentation‎ | BASIC Guide
Revision as of 18:57, 27 December 2008 by TJFrazier (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Bracketed stuff in section "Cell Properties" --TJ 16:12, 4 October 2007 (CEST)

Thanks, TJ. Fixed -- Fpe 10:37, 5 October 2007 (CEST)

Breakup suggested

Editing suggestion: break this page into 5 parts: overview / sheets / rows & columns / cells & ranges / formatting.--TJ 22:55, 4 October 2007 (CEST)

Agreed. Breakup implemented -- Fpe 10:55, 5 October 2007 (CEST)

Invalid examples

I am an experienced VBA programmer trying to learn how to program OpenOffice. When I tried the first example it failed with the following error message: Basic Runtime Error Property or Method not found.

This is a showstopper for me, if I can't access my spreadsheet programmatically it's pointless me using OpenOffice.

Seconded. StarDesktop.CurrentComponent returns the IDE and ThisComponent returns the above error.

Newbie here, but I'd like to contribute. Because the example uses StarDesktop.CurrentComponent, if you set a break-point, or run from the Basic IDE, the CurrentComponent is the Basic IDE instead of the SpreadsheetDocument (i.e. Workbook). There is a simple workaround, assuming that your macros are in the same SpreadsheetDocument as the Sheet your data is on. I'll leave that workaround as an exercise for the reader (since I find the documentation to be lacking so I haven't yet found out how to determine the active SpreadsheetDocument). *wink* -- LabSpeciman 05:15, 4 August 2008 (CEST)

WorksForMe under version 3.0, much to my surprise. I thought you had to use the "get by index" method.
Any problem was with Sheets, not ThisComponent (did you leave off the final "s"?). The old way was:
Dim oSheets as Object
oSheets = Doc.Sheets
Sheet = oSheets.getByIndex(0)
See StarDesktop for more on that and ThisComponent. Any further explanations will be documented there. --TJ 19:57, 27 December 2008 (CET)
Personal tools