VB+Excel(2)

frankyp

Grünschnabel
Hallo

Ich habe aus der VB-Hilfe folgendes ausprobiert

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
' Place some text in the second row of the sheet.
xlSheet.Cells(2, 2) = "This is column B row 2"
' Show the sheet.
xlSheet.Application.Visible = True
' Save the sheet to C:\Test.xls directory.
xlSheet.SaveAs("C:\Test.xls")
' Optionally, you can call xlApp.Quit to close the work sheet.
End Sub

und bekomme die Meldung

Sub oder Function nicht definiert

Weiss hier jemand Rat ?

Entschuldigung die erste Anfrage ist mir von der Textaufteilung
etwas komisch geraten

Danke

Gruss

FrankyP
 
Du hast zwar ein

End Sub

in deinem Code aber keine Defintion der Methoden-Signatur ... also

Sub MeineFunktion .....

Daran wirds wohl liegen ...
 
Zurück