473,480 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

QueryInterface, with the object Excel.Application

Hello,

With Asp.Net, I try to generat a document with an Excel object.

This is the begin of my procedure:
Dim xapExcel As Excel.Application
xapExcel = New Excel.Application()
xapExcel.Visible = False

At the last line I obtain this error:
"System.InvalidCastException: QueryInterface for interface
Excel._Application failed."

Other clues:
- I have granted AspNet to run Excel (with the tool DComCnfg.exe).
- I use Office XP in english, but the Os and .Net was in french. I have make
some tests without succes by changing CurrentCulture.

Someone have a solution ?

Regards.

Nov 17 '05 #1
2 2238
Hi,
Its better to use tlbimp when you use COM. here a detailed article of
what you are looking for :
http://www.c-sharpcorner.com/Code/20...elSheetGAG.asp

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
Thanks for your answer;

tlbimp was certainly usefull for Excel 5, 2000.
But I think we didn't need it for Office XP (2002)

And in add, it was recommanded on every doc I find for C and not for VB.

(Or I didn't understand tlbimp use)

Regards.
Nov 17 '05 #3

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

Similar topics

11
9198
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
3
9129
by: Dent2 | last post by:
I wrote a nice C# excel routine to automate the formatting of some raw CSV data. I wrote the routine on a WinXP computer with Visual Studio .NET 2003 and Office XP installed. It compiled and ran...
1
2265
by: KC | last post by:
Hi Gurus, I am having problem opening an excel file from vb.net. My code looks like this: Dim EXL as Excel.Application Dim wrkbook As Excel.Workbook EXL = GetObject("", "Excel.Application")...
0
1233
by: Deeps | last post by:
Hi I have created an interface called IGlobal with some properties exposed with a fixed Guid. Created a class inherting this interface. This is my com+ server. I have a client instantiating this...
1
1293
by: Ugo | last post by:
Hi, I have just followed the Microsoft Knowledge Base Article - 302084 How to Automate Microsoft Excel from Microsoft Visual C# .Net http://support.microsoft.com/default.aspx?kbid=302084 and I...
6
9330
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...
6
410
by: Rich Wallace | last post by:
Hi all, I have a VB app that runs and manages individual XLS files within a single COM object. Upon processing the final fie, I attempt to close out the EXCEL object and release it using...
0
1112
by: DidierT | last post by:
Hi everybody, I'm developping a web service application which access to several COM objects contained in an EXE file. I've created Interop (using tlbimpl tool) for all typelib. In my webservice...
2
3234
by: Stan | last post by:
Hello All: Don;t know if this is the correct group to post this in but here goes. Getting this error when trying to create excel object using Outlook Web Components on our web server. Any help...
0
7033
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
7027
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,...
1
6726
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6861
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...
0
5318
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4468
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2987
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.