
CreateObject("Excel.Sheet")
2 things (I am unsure of as you have only put some of the code), have you
placed dim xlsheet before this? and have you opened excel before trying to
create a sheet? i.e.-
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.WorkSheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
Hope this helps, the above opens excel, adds a new workbook, then a new
sheet.
Alex Read
Quote:
> Hi.
> I am trying to run some code found in the magazine Access-Office-VB
Advisor,
> where a table from a web-page is copied into Excel. I am running
Windows2000
> and Excel2000, and my web-browser returns the error-message (see the code
> listed futher down) "You need Excel 95 or higher on your system.". This
> indicate that the browser is not able to create the
> CreateObject("Excel.Sheet"). Shouldn't the web-browser be able to run the
> CreateObject("Excel.Sheet") when I have Excel installed?
> Do anyone have an ide of what I have done wrong?
> Here is som pieces of the code:
> 'Create the Excel worksheet.
> Set xlSheet = CreateObject("Excel.Sheet")
> 'If the object is created then make a worksheet.
> If IsObject(xlSheet) Then
> ......
> Else
> 'If there is no Excel object then Excel is probably 'not on the
machine
> MsgBox "You need Excel 95 or higher on your system.", vbOkOnly,
"Report
> Error"
> End If
> Thanks,
> Lorents Nord-Varhaug