PC Review


Reply
 
 
lee
Guest
Posts: n/a
 
      4th Feb 2004
Hi!
I need to open and fill excel cells from my winform
application, however, I do not want to use the excel
object model, I would like to use late binding.
(In VB 6 - CreatObject("Excel") - was used).
Does anyone know how to do this in C#?
A simple sample would be very appreciated!
Thanks alot!

 
Reply With Quote
 
 
 
 
Richard Grimes [MVP]
Guest
Posts: n/a
 
      16th Feb 2004
lee wrote:
> Hi!
> I need to open and fill excel cells from my winform
> application, however, I do not want to use the excel
> object model, I would like to use late binding.
> (In VB 6 - CreatObject("Excel") - was used).
> Does anyone know how to do this in C#?
> A simple sample would be very appreciated!
> Thanks alot!


Late binding was never a good idea in VB. I never like telling people that
their request is not a good idea, but I am afraid in this case there is no
solution. Late binding is horrible and should never have been available in
VB because it has caused far too many problems and those problems are
usually only detectable at runtime. You have a compiler, and the compiler
enforces early binding and type checking, there is a good reason for this.

*Use the compiler Luke!*

Richard
--
my email (E-Mail Removed) is encrypted with ROT13 (www.rot13.org)
sign up for my free .NET newsletter at
http://www.wd-mag.com/newsletters/


 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      16th Feb 2004
The same thing works in vb.net.
call create object and pass in the excel object. the excel object is exposed
by adding a reference to the owc10 library. there are issues with
performance and scalability so do not forget to explicitly clean up the
resources when you are done.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Richard Grimes [MVP]" <read my sig> wrote in message
news:eW%(E-Mail Removed)...
> lee wrote:
> > Hi!
> > I need to open and fill excel cells from my winform
> > application, however, I do not want to use the excel
> > object model, I would like to use late binding.
> > (In VB 6 - CreatObject("Excel") - was used).
> > Does anyone know how to do this in C#?
> > A simple sample would be very appreciated!
> > Thanks alot!

>
> Late binding was never a good idea in VB. I never like telling people that
> their request is not a good idea, but I am afraid in this case there is no
> solution. Late binding is horrible and should never have been available in
> VB because it has caused far too many problems and those problems are
> usually only detectable at runtime. You have a compiler, and the compiler
> enforces early binding and type checking, there is a good reason for this.
>
> *Use the compiler Luke!*
>
> Richard
> --
> my email (E-Mail Removed) is encrypted with ROT13 (www.rot13.org)
> sign up for my free .NET newsletter at
> http://www.wd-mag.com/newsletters/
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Specifying a late-bound DLL's location Stu Microsoft C# .NET 0 18th Feb 2009 08:32 PM
Early bound to Late bound Henk Microsoft Excel Programming 2 13th Feb 2009 02:01 AM
EventHandler for late-bound COM object Phil Microsoft VB .NET 4 28th Nov 2007 02:55 AM
Late bound type conversion zdrakec Microsoft VB .NET 5 7th Oct 2005 07:40 PM
can a late bound delegate be called in a late bound C# dll? Daniel Microsoft C# .NET 1 17th Dec 2004 06:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:11 AM.