473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cannot create ActiveX component

Hi,

My web development server is a Windows 2000 SP4 system.
Had created an aspx page with the following code which I had extracted from
1 of the Microsoft websites:

Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object

'Start a new workbook in Excel.
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add

'Add data to cells of the first worksheet in the new workbook.
oSheet = oBook.Worksheets(1)
oSheet.Range("A1").Value = "Last Name"
oSheet.Range("B1").Value = "First Name"
oSheet.Range("A1:B1").Font.Bold = True
oSheet.Range("A2").Value = "Doe"
oSheet.Range("B2").Value = "John"

'Save the Workbook and quit Excel.
oBook.SaveAs("C:\Temp\Book1.xls")
oSheet = Nothing
oBook = Nothing
oExcel.Quit()
oExcel = Nothing
GC.Collect()

When I attempted to run & debug the aspx page, I encountered the following
error message on the statement,
oExcel = CreateObject("Excel.Application"):

System.Exception was unhandled by user code
Message="Cannot create ActiveX component."
Source="Microsoft.VisualBasic"
StackTrace:
at Microsoft.VisualBasic.Interaction.CreateObject(Str ing ProgId,
String ServerName)
at ASP.createexcel_aspx.Button1_Click(Object sender, EventArgs e) in
C:\Inetpub\ASP\CreateExcel.aspx:line 18
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection
postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint
I had also tried the same code on another WinXP system where there is
Microsoft Excel installed & it worked out fine.
Thinking I have to install Microsoft Excel on the Win2000 system as well,
but it gave the same error message after I had installed Microsoft Excel.
Anything I had missed out?

Thanks in advance.

Regards,
Michael.
Mar 14 '07 #1
3 3013
"Administrator" <Ad***********@gaelicinns.com.sgwrote in message
news:e8**************@TK2MSFTNGP06.phx.gbl...
Anything I had missed out?
The first thing to realise is that server-side Office automation is highly
likely not to work... Microsoft actively discourages its use to the extent
where they won't actually give any support at all to a solution which uses
it: http://support.microsoft.com/default...US;q257757#kb2 (see
the paragraph in bold)

The problem you are currently facing is entirely consistent with this.

Luckily, there is no need to use server-side Office automation, as several
other solutions exist depending on what you are trying to do...

What are you trying to do...?
Mar 14 '07 #2
I'm trying to see if I can create, update & delete an excel worksheet from
an aspx page.
Any workaround?
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
"Administrator" <Ad***********@gaelicinns.com.sgwrote in message
news:e8**************@TK2MSFTNGP06.phx.gbl...
Anything I had missed out?

The first thing to realise is that server-side Office automation is highly
likely not to work... Microsoft actively discourages its use to the extent
where they won't actually give any support at all to a solution which uses
it: http://support.microsoft.com/default...US;q257757#kb2
(see
the paragraph in bold)

The problem you are currently facing is entirely consistent with this.

Luckily, there is no need to use server-side Office automation, as several
other solutions exist depending on what you are trying to do...

What are you trying to do...?


Mar 15 '07 #3
"Administrator" <Ad***********@gaelicinns.com.sgwrote in message
news:uo*************@TK2MSFTNGP05.phx.gbl...
I'm trying to see if I can create, update & delete an excel worksheet from
an aspx page.
Any workaround?
1) Use HTML
Output the data as HTML, then save it with an .xls extension - Excel will
work with it just like a native workbook.

2) Use the XML file format
http://www.microsoft.com/downloads/d...displaylang=en
http://www.microsoft.com/downloads/d...displaylang=en

3) Use ADO.NET
http://www.google.co.uk/search?sourc...DO%2eNET+Excel
Once the file has been created initially, ADO.NET can update it just like
any other OleDb data source.

4) Use a 3rd-party tool
http://www.aspose.com/Products/Aspos...s/Default.aspx
Mar 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pat | last post by:
A97, WinXP Hello, I am looking for a way to create a task (in the windows task scheduler) from an Access MDB using VBA. I found this great DLL: ...
3
by: DB | last post by:
Hi Folks, I want to create Activex component. Can we create it using c#.net or do I need to create it using vc++? Thanks in Advanced, Deepak
1
by: Zhou Jingxiong | last post by:
Hi I am using third party COM component which come with an installation program (.exe file included). The program will be register to registry automatically upon installation. There is no...
2
by: W. Broersen | last post by:
I want to use Outlook.Application, but I donot get further. Dim objOLApp As Outlook.Application objOLApp = CreateObject("Outlook.Application") Everytime I'll get the following error: Cannot...
6
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
0
by: Andrew Luke | last post by:
Hi There, I'm trying to get a listing of shares from a server. The server is a linux box running samba and LDAP for directory services (just for background info!) I have some code which I...
1
by: Rocio | last post by:
I have a windows app. written in VB6, now we need to expose some of its classes through a web service. I am only able to expose the classes using late binding becasue that's the way the original...
2
by: Shlomi | last post by:
Hi, I'm developing an application that runs in AspNet on Win2003 server. Every thing runs OK in the development environment, but in the customer site I have a problem running...
16
by: Heinz K | last post by:
Hello all, I'm developing a vb.net 2.0 webservice which accesses a lotus notes database using lotus domino api. This works fine on my local client if I select "Use Visual Studio Development...
0
by: rrotstein | last post by:
I took a simple VB 6.0 .dll project, consisting of a single form, and used Vistual Studio 2005 to upgrade it and create a new solution. I then registered it and created a type library using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.