CreateObject("Excel.Sheet") 
Author Message
 CreateObject("Excel.Sheet")

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



Fri, 07 Feb 2003 03:00:00 GMT  
 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



Fri, 07 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CreateObject("Excel.Sheet")

2. VB SCript: CreateObject("Excel.Sheet") function

3. CreateObject("Excel","//server"), MsgBox output

4. CreateObject("Excel","//server"), MsgBox output

5. Problem with "Excel.Sheet"

6. CreateObject("Excel.Application") Error

7. CreateObject("Excel.Application")

8. CreateObject("Excel.Application") problem

9. CreateObject("Excel.Application")

10. CreateObject("Excel.Application")

11. Createobject, excel "times out"

12. Set xLApp = CreateObject("Excel.Application")

 

 
Powered by phpBB® Forum Software