Click to See Complete Forum and Search --> : Client Application [Excel]


davisba
July 14th, 1999, 12:49 PM
When I use the following code (with MicroSoft Excel 8.0 Object Library referenced):
Private Sub Command_Click()
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Sheet")
objExcel.Cells(1,1).Value = "2"
End Sub

there is a run time error (438, "object does not support the propterty or method:) at the last code line (objExcel.Cells(1,1).Value = "2"
CAN ANYONE HELP?

Lothar Haensler
July 15th, 1999, 01:56 AM
this works only when you have a workbook as in

Dim x as Excel.Application
set x = CreateObject("excel.application")
x.Visible = true
Dim w as Excel.Workbook
set w = x.Workbooks.Add
x.Cells(1, 1).Value = "2"

Cimperiali
October 16th, 2001, 09:24 AM
;)
Sorry, Lothar: I am out of votes for today...

Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater