473,830 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to start excel from .NET C#

This is my first attempt, please bear.

I referenced Excel 10.0 Object from VS .NET IDE, I think this creates
Interop Object for Excel.

I have the following code.

------code start----

using System;
using System.Runtime. InteropServices ;
using Excel;

namespace ConsoleApplicat ion3
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
Excel.Applicati on app = new Excel.Applicati onClass();
app.Visible = true;

}
}
}

---code end----

When the start the code I get the following error messages, the build
is OK though.

DefaultDomain': Loaded
'c:\winnt\micro soft.net\framew ork\v1.0.3705\m scorlib.dll', No symbols
loaded.
'ConsoleApplica tion3': Loaded 'C:\Documents and
Settings\Admini strator\My Documents\Visua l Studio
Projects\Consol eApplication3\b in\Debug\Consol eApplication3.e xe',
Symbols loaded.
'ConsoleApplica tion3.exe': Loaded 'c:\documents and
settings\admini strator\my documents\visua l studio
projects\consol eapplication3\b in\debug\intero p.excel.dll', No symbols
loaded.
The program '[2604] ConsoleApplicat ion3.exe' has exited with code 0
(0x0).

----

I would really like to know what is going on, Excel is not
instantiated .!

Any help appreciated.
Nov 15 '05 #1
2 4746
Hi Krish,

Just to confirm, do you not see Excel coming up at all,
or does it quickly start up and shutdown the moment
your console app exits. Try inserting a Console.ReadLin e()
soon after you create an instance of Excel.Applicati on.

Excel.Applicati on excelApp = new Excel.Applicati on();
excelApp.Visibl e = true;
Console.WriteLi ne("Excel up and running now. Press any key to close Excel");
Console.ReadLin e();
excelApp.Quit() ;
Regards,
Aravind C
"Krish" <sk*******@snet .net> wrote in message
news:87******** *************** ***@posting.goo gle.com...
This is my first attempt, please bear.

I referenced Excel 10.0 Object from VS .NET IDE, I think this creates
Interop Object for Excel.

I have the following code.

------code start----

using System;
using System.Runtime. InteropServices ;
using Excel;

namespace ConsoleApplicat ion3
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
Excel.Applicati on app = new Excel.Applicati onClass();
app.Visible = true;

}
}
}

---code end----

When the start the code I get the following error messages, the build
is OK though.

DefaultDomain': Loaded
'c:\winnt\micro soft.net\framew ork\v1.0.3705\m scorlib.dll', No symbols
loaded.
'ConsoleApplica tion3': Loaded 'C:\Documents and
Settings\Admini strator\My Documents\Visua l Studio
Projects\Consol eApplication3\b in\Debug\Consol eApplication3.e xe',
Symbols loaded.
'ConsoleApplica tion3.exe': Loaded 'c:\documents and
settings\admini strator\my documents\visua l studio
projects\consol eapplication3\b in\debug\intero p.excel.dll', No symbols
loaded.
The program '[2604] ConsoleApplicat ion3.exe' has exited with code 0
(0x0).

----

I would really like to know what is going on, Excel is not
instantiated .!

Any help appreciated.

Nov 15 '05 #2


Thanks Aravind, I did notice that the console.readlin e causes
the cmd window to stay there.

What are the error messages that I included at the bottom of the
message, that say no symbols loaded, is this just a message from the
debugger.

Also when you look at the object browser, you see Excel {} the curly
braces does it mean namespace.

Thanks for your help.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

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

Similar topics

8
3405
by: Chris Bailiss | last post by:
Hi all, I am unable to run any VBA in access XP. I get the compile error of 'Error In Loading DLL'. Behaviour of the wizards is also patchy. I cannot get past the first screen in most (i.e. the buttons in the wizard screens are dead). I presume the wizards run VBA underneath. I have installed the latest service pack, both windows xp and office xp. It was a clean XP install.
0
1880
by: Steve Chatham | last post by:
I am stuck on this. It ought to be a simple reason as to why this is problematic, in that it works on smaller groups of data (say under 40 records), but doesn't on larger groups of records (40+). I'm displaying 9 columns in a datagrid, and have a radiobutton at the top of the page that says Web, Excel & Word. Web is selected by default. If you click one of the other two buttons, this code is executed: Private Sub...
16
4231
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
3
4067
by: C Williams | last post by:
I am using Visual Studio 2003 and trying to use the "Start External Program" option to start Excel when I run the program. What happens is that Excel opens and then immediately closes. I know that in the past it has opened and stayed open, and I am wondering what I have inadvertently changed and how I can change it back. Thanks, -Casey
4
4405
by: Eric W | last post by:
I am converting an EXCEL VBA application to Visual Basic (2003). I am not having much luck finding how to convert statements containing references to things like ThisWorkbook.Sheets("sheetname"). I am not using Visual Studio Tools (which may be my problem, tho I would think that I don't really need the templates --- or do I??) Eric
1
2407
by: Craig Coope | last post by:
I may be barking up the wrong tree here (maybe I can do all this in Excel) but... I have created an Excel sheet that lets me input job start and finish times and the amount of work done within the jobs so that I can work out "total work per hour" etc....it works very well but I have to input the times and workload manually... Now is there anyway Excel or Excel linked with Access can be used so that for example, someone comes along and...
1
1139
by: Sehboo | last post by:
I just installed VS 2003 and now trying to run the asp.net application. But I get the message that "Unable to start debugging on the web server. you do not have permissions to debug the server. Verify that you are member of the debugger user group on the server. I am user of this group. This is the a simple web app with just one button, which does nothing. It was created by VS2003. Virtual directory was created for me. I checked and...
3
5088
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, Is there anything wrong with the code below in sending my browser page to Excel? Before my page opens in Excel there's a message "Problems came up in the following areas during load:" and it shows a CSS file in the "temporary internet files" path. But when i click OK the page displays beautifully. Even though my page has 3 datagrids, they all display with the same style as seen in the browser page. Though, the second problem is,...
4
5923
by: keirnus | last post by:
Hello, I've been coding in Access VBA to create an Excel Graph and it was good. Until I got this error: Please check the code below: Private Sub TestGraph3()
0
9793
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10777
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10493
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10526
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7747
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3960
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.