Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2007, 09:30 AM
Authorized User
 
Join Date: Jul 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel 9.0 Object Library in C# .NET

Hi all,

I'm trying to create an excel object and do whatever I want with it. Just like how I would in Visual Foxpro 6 and Visual Basic 6. I add a reference to the Excel 9.0 Object Library via the COM tab.

It seems I can't access certain properties, objects, and collections. For instance if I do:


            Excel.Application objExcel = new Excel.Application();
            Excel.Workbook objBook = new Excel.Workbook();
            objBook = objExcel.Workbooks.Add();


I get an error saying there is no definition for Workbooks contained in Excel.Application.


But if I double click on the Reference, it opens Interop.Excel9.dll and I can find a "Workbooks" Collection in the Treeview with all the methods and properties.


Can someone help sort this out for me? What hoops of fire do I have to jump through to do some Excel automation?



Thanks

 
Old July 17th, 2007, 09:28 AM
Authorized User
 
Join Date: Jul 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I solved my problem, although I'm not sure how or why. I deleted VBIDE.dll, Office.dll, and Interop.Excel9.dll from my bin\debug folder. I then readded the reference to Excel 9.0 Object library through the COM tab, and now all the methods and properties are there.

The Interop.Excel9.dll file it copied to my bin\debug folder is larger (by 200k) than the one I deleted. I'm not sure why the file is larger all the sudden, but it is.

I'm using Windows 2000 with Office 2000.

Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
out look object library or redemptipn.dll pradeep29 .NET Framework 2.0 0 July 27th, 2007 10:56 PM
Object Library maxpotters Excel VBA 1 January 2nd, 2006 05:46 PM
Object Library (VBA Excel), asking help here maxpotters Pro VB 6 0 December 31st, 2005 08:04 AM
InfoPath 2003 Object Library debsoft General .NET 2 April 30th, 2004 09:36 AM
Accessing Word Object Library from .NET Web app debsoft General .NET 3 April 21st, 2004 05:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.