CreateObject("Excel.Application") problem 
Author Message
 CreateObject("Excel.Application") problem

Hi all,

I got a problem with scripting Excel application in asp.
I have use the below code to open an excel file

Dim xlApp, xlBook, xlSheet1

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet1 = xlBook.Worksheets(1)

xlSheet1.cells(1,1).value = "11"
xlSheet1.cells(2,1).value = "11"
xlSheet1.cells(2,2).value = "11"
xlSheet1.cells(2,3).value = "11"
xlSheet1.cells(2,4).value = "11"

xlBook.SaveAs "c:\monthly.xls"

xlApp.Quit
Set xlApp = Nothing

I run it in IIS of three different OSs  and got different
results. Can anyone advise me what is happening?

1. OS - Windows NT 4.0 SP 6
   The file successfully created without any problem

2. OS - Windows 2000 Professional SP3
   There is an internal server error 500

3. OS - Windows 2000 Server SP2
   The file successfully created together with a shortcut

Thanks a lot
Wahodi



Fri, 18 Nov 2005 18:11:36 GMT  
 CreateObject("Excel.Application") problem

Quote:
> Hi all,

> I got a problem with scripting Excel application in asp.
> I have use the below code to open an excel file

> Dim xlApp, xlBook, xlSheet1

> Set xlApp = CreateObject("Excel.Application")
> Set xlBook = xlApp.Workbooks.Add
> Set xlSheet1 = xlBook.Worksheets(1)

> xlSheet1.cells(1,1).value = "11"
> xlSheet1.cells(2,1).value = "11"
> xlSheet1.cells(2,2).value = "11"
> xlSheet1.cells(2,3).value = "11"
> xlSheet1.cells(2,4).value = "11"

> xlBook.SaveAs "c:\monthly.xls"

> xlApp.Quit
> Set xlApp = Nothing

> I run it in IIS of three different OSs  and got different
> results. Can anyone advise me what is happening?

> 1. OS - Windows NT 4.0 SP 6
>    The file successfully created without any problem

> 2. OS - Windows 2000 Professional SP3
>    There is an internal server error 500

> 3. OS - Windows 2000 Server SP2
>    The file successfully created together with a shortcut

> Thanks a lot
> Wahodi

May well be because the account used for creating the file does not have
permissions to write to C: drive. If anonymous access is allowed then this
account would normally be IUSR_<machinename>. If not then the account of the
person viewing the page needs the correct rights.

Joe



Fri, 18 Nov 2005 18:16:37 GMT  
 CreateObject("Excel.Application") problem
1.  Cool
2.  What's the real error?  http://www.aspfaq.com/show.asp?id=2109
3.  With a shortcut?  Where?

Ray at work


Quote:
> Hi all,

> I got a problem with scripting Excel application in asp.
> I have use the below code to open an excel file

> Dim xlApp, xlBook, xlSheet1

> Set xlApp = CreateObject("Excel.Application")
> Set xlBook = xlApp.Workbooks.Add
> Set xlSheet1 = xlBook.Worksheets(1)

> xlSheet1.cells(1,1).value = "11"
> xlSheet1.cells(2,1).value = "11"
> xlSheet1.cells(2,2).value = "11"
> xlSheet1.cells(2,3).value = "11"
> xlSheet1.cells(2,4).value = "11"

> xlBook.SaveAs "c:\monthly.xls"

> xlApp.Quit
> Set xlApp = Nothing

> I run it in IIS of three different OSs  and got different
> results. Can anyone advise me what is happening?

> 1. OS - Windows NT 4.0 SP 6
>    The file successfully created without any problem

> 2. OS - Windows 2000 Professional SP3
>    There is an internal server error 500

> 3. OS - Windows 2000 Server SP2
>    The file successfully created together with a shortcut

> Thanks a lot
> Wahodi



Fri, 18 Nov 2005 20:48:36 GMT  
 CreateObject("Excel.Application") problem
Hi Ray and Joe,

Thanks for your reply.

For the windows 2000 professional the real error is
Microsoft VBScript runtime error '800a0046'

Permission denied: 'CreateObject'

/rar/testing.asp, line 7

For the Windows 2000 Server SP2
the shortcut created is also at c:/

Best regards,
Wahodi


Quote:
> Hi all,

> I got a problem with scripting Excel application in asp.
> I have use the below code to open an excel file

> Dim xlApp, xlBook, xlSheet1

> Set xlApp = CreateObject("Excel.Application")
> Set xlBook = xlApp.Workbooks.Add
> Set xlSheet1 = xlBook.Worksheets(1)

> xlSheet1.cells(1,1).value = "11"
> xlSheet1.cells(2,1).value = "11"
> xlSheet1.cells(2,2).value = "11"
> xlSheet1.cells(2,3).value = "11"
> xlSheet1.cells(2,4).value = "11"

> xlBook.SaveAs "c:\monthly.xls"

> xlApp.Quit
> Set xlApp = Nothing

> I run it in IIS of three different OSs  and got different
> results. Can anyone advise me what is happening?

> 1. OS - Windows NT 4.0 SP 6
>    The file successfully created without any problem

> 2. OS - Windows 2000 Professional SP3
>    There is an internal server error 500

> 3. OS - Windows 2000 Server SP2
>    The file successfully created together with a shortcut

> Thanks a lot
> Wahodi



Mon, 21 Nov 2005 10:11:32 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CreateObject("Excel.Application") Error

2. CreateObject("Excel.Application")

3. CreateObject("Excel.Application")

4. CreateObject("Excel.Application")

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

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

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

8. Server.CreateObject("Excel.Application")

9. CreateObject("Excel.Application") Fails on NT

10. CreateObject("Outlook.Application") problem

11. Problems with Createobject("Outlook.Application")

12. GetObject("","InternetExplorer.Application") fails in Excel VBA

 

 
Powered by phpBB® Forum Software