Guido H. Dirkes wrote:
> 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>

In etwa aus der *Hilfe*:
(zum besseren Verständnis etwas umformatiert)

If Bedingung=true Then
  Anweisungsblock
[ElseIf Bedingung=true Then]
  Anweisungsblock
[Else]
  Anweisungsblock
End If

Steht zwar unter 'Syntax' nicht so eindeutig drin, aber das Beispiel
kann mensch eigentlich nicht missverstehen;)

> and OpenOffice complains 
> BASIC syntax error.
> unexpected: Then .
> 
> 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....

Jede Sprache hat ihre 'Eigenheiten'...
(Wie das in VBA ist weiß ich nicht)

> I even started to think about changing to Excel, as VBA seems to be much more 
> straight forward to use. 
No Comment;)

> So any help welcome.
HTH

Gruß, Michel
-- 

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

Antwort per Email an