Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

How to use c# to access the names that defined in excels?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
marxi - 31 Jan 2007 01:21 GMT
Hi:
    I would like to use c# to access the names that defined in components
axspreedsheet. But I can not accomplish. why? the code like the followings:
System.Collections.IEnumerator myEnumerator =  
Spreadsheet1.Names.GetEnumerator();
                  Console.WriteLine("The Array contains the following
values:");
           int i = 0;
           while ((myEnumerator.MoveNext()) && (myEnumerator.Current !=
null))
                       Console.WriteLine("[{0}] {1}", i++,
myEnumerator.Current);

the results only list "System._ComObject". why?
Is it can not access just because the type is protected?
Signature

Happy Everyday!

Ciaran O''Donnell - 31 Jan 2007 13:35 GMT
The enumerator you are using is not returning strings to you. It is returning
an object (probably of type name). I would suggest looking at the object in
the debugger and seeing what property it may have to access the name.

Signature

Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com

> Hi:
>      I would like to use c# to access the names that defined in components
[quoted text clipped - 11 lines]
> the results only list "System._ComObject". why?
> Is it can not access just because the type is protected?
marxi - 02 Feb 2007 01:15 GMT
I know it is a Object type. But it located at final level. It has no
property. How can i access to it?
Signature

marxi

> The enumerator you are using is not returning strings to you. It is returning
> an object (probably of type name). I would suggest looking at the object in
[quoted text clipped - 15 lines]
> > the results only list "System._ComObject". why?
> > Is it can not access just because the type is protected?
marxi - 03 Feb 2007 04:35 GMT
can you helpl me? this problem have confused me many days! thank you very much!
Signature

marxi

> I know it is a Object type. But it located at final level. It has no
> property. How can i access to it?
[quoted text clipped - 18 lines]
> > > the results only list "System._ComObject". why?
> > > Is it can not access just because the type is protected?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.