Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Testing with Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brett - 30 Jan 2008 16:17 GMT
I'm writing a software program using .NET framework 2.0 with Excel 2007
installed on my dell laptop machine. I'm developing with Visual Studio 2005
using C#.
I have a method the first creates an instance of the Excel application:
Microsoft.Office.Interop.Excel.Application excelApp = new
Microsoft.Office.Interop.Excel.Application();
i then test the excelApp object to see if it is null and if it's null then
that means that Excel doesn't exist on the machine that is hosting the
application i'm developing, right?
or will the application throw an exception because excel doesn't exist on
the machine? how can i test to see if Excel is installed on the machine
without the application breaking if it is not installed? i currently have
Microsoft.Office.Core and Microsoft.Office.Interop.Excel as references and i
am using System.Runtime.InteropServices in the class i am coding in. any
help would be mush appreciated.

brett
Jim Cone - 30 Jan 2008 17:21 GMT
brett,
I doubt if you will get an answer in this newsgroup.
This a newsgroup for general Excel questions of a non-programming nature.  
However, even the public.excel.programming newsgroup centers largely
around VBA and VBScript with the occasional API call thrown in.
Unless some VBA code using Create Object and Set statements would
be of value, one of the Visual Studio newsgroups would be a better choice.
Signature

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"Brett" <runswithsticks10@sbcglobal.net>
wrote in message
I'm writing a software program using .NET framework 2.0 with Excel 2007
installed on my dell laptop machine. I'm developing with Visual Studio 2005
using C#.
I have a method the first creates an instance of the Excel application:
Microsoft.Office.Interop.Excel.Application excelApp = new
Microsoft.Office.Interop.Excel.Application();
i then test the excelApp object to see if it is null and if it's null then
that means that Excel doesn't exist on the machine that is hosting the
application i'm developing, right?
or will the application throw an exception because excel doesn't exist on
the machine? how can i test to see if Excel is installed on the machine
without the application breaking if it is not installed? i currently have
Microsoft.Office.Core and Microsoft.Office.Interop.Excel as references and i
am using System.Runtime.InteropServices in the class i am coding in. any
help would be mush appreciated.

brett

Brett - 30 Jan 2008 17:28 GMT
OK, thanks for the response.

> brett,
> I doubt if you will get an answer in this newsgroup.
[quoted text clipped - 3 lines]
> Unless some VBA code using Create Object and Set statements would
> be of value, one of the Visual Studio newsgroups would be a better choice.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.