Hi,

On 30.11.2006 09:40, Guido H. Dirkes wrote:
> Dear all,
> 
> looks like I am to stupid for this. I tried the following code
> 
> <code start>
> Sub Main
>       Dim Doc As Object
>       Dim Sheet As Object
>       Doc = StarDesktop.CurrentComponent 
>       Sheet = Doc.Sheets(0)
>       If Doc.Sheets.hasByName("TestRack") 
>       Then Sheet = Doc.Sheets.getByName("TestRack") 
>       Else Sheet = Doc.createInstance("com.sun.star.sheet.Spreadsheet") 
>               Doc.Sheets.insertByName("TestRack", Sheet) 
>       End If
> End Sub
> <code end>
> 
> and OpenOffice complains 
> BASIC syntax error.
> unexpected: Then .

das "then" muss in die zeile mit dem "if", ich kenn das nur so.

> 
> When I change the code to so that I have all the line starting from If up to 
> End If in one line than it complains about the Doc.Sheets.insertByName...
> 
> This makes no sense at all to me....
> 
> I even started to think about changing to Excel, as VBA seems to be much more 
> straight forward to use. 

Das ist auch in VB so, in VBA nicht?!

Gruß,
Ingo

-- 
## Registered Linux User #274727 -- http://counter.li.org/
## Windows, Linux und Mac Office-Suite -- http://de.openoffice.org/
## Die OpenOffice.org PrOOo-Box -- http://prooo-box.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Antwort per Email an