473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

For each ... Next Question

PS
Hi,

In Excel VBA, I can read Excel add-in member name through this code ...

--------------
Dim e As Excel.AddIn
For Each e In Application.AddIns
Debug.Print e.Name
Next
--------------

But in VB.Net, It results in Error.

--------------
Imports Excel = Microsoft.Office.Interop.Excel

Module Module1
Sub Main()
Dim xl As New Excel.Application
xl.Workbooks.Add()
xl.Visible = True
Dim e As Excel.AddIn
For Each e In xl.AddIns ' <<---Error
Console.WriteLine(e.Name)
Next
Console.ReadLine()
End Sub
End Module
----------------

Of course, I can acqure right results by this code ...

---------------
Dim i As Integer
For i = 1 To xl.AddIns.Count
Console.WriteLine(xl.AddIns(i).Name)
Next
---------------
How can it be done by [for each] [Next] routine?
Nov 20 '05 #1
1 1027
hmmm. this is interesting to me. I want to know the answer also.
One note. Since e is the variable name for one of the 2 param passed to
every event in vb I would refrain from using it for any other purpose.

Also, what is the error that might help us...??

Shane

"PS" <ps*****@hotmail.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
Hi,

In Excel VBA, I can read Excel add-in member name through this code ...

--------------
Dim e As Excel.AddIn
For Each e In Application.AddIns
Debug.Print e.Name
Next
--------------

But in VB.Net, It results in Error.

--------------
Imports Excel = Microsoft.Office.Interop.Excel

Module Module1
Sub Main()
Dim xl As New Excel.Application
xl.Workbooks.Add()
xl.Visible = True
Dim e As Excel.AddIn
For Each e In xl.AddIns ' <<---Error
Console.WriteLine(e.Name)
Next
Console.ReadLine()
End Sub
End Module
----------------

Of course, I can acqure right results by this code ...

---------------
Dim i As Integer
For i = 1 To xl.AddIns.Count
Console.WriteLine(xl.AddIns(i).Name)
Next
---------------
How can it be done by [for each] [Next] routine?

Nov 20 '05 #2

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

Similar topics

8
by: joe | last post by:
Can anyone help me out by either telling me how to get to the result i need or by pointing me to some documentation about the following question: A certain query to a database give me eg 100...
1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
4
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
4
by: Vincent Yang | last post by:
I'm using Access 2002. My database is in Access 2000 format. I'm designing a form to collect responses to a 40-item questionnaire. I can fit four list boxes on a screen, so I plan to have 11 tab...
2
by: Deniz Bahar | last post by:
Hi, I'm working with a single linked list and want to delete elements by searching through the list (starting form the HEAD) then finding the element, then doing the following: NewElement =...
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
2
by: winnie_us99 | last post by:
Hi All, I am trying to do validation on my text field before going to the next page to create a user. It doesn't look like the next button will fire any validation. Am I missing something? Can...
8
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
I am working with Visual C# window and in my application I need to use a button ( NEXT) . The button should displays one panel with its objects each time it clicked. I already developed the codes...
0
by: Ignacio Machin ( .NET/ C# MVP ) | last post by:
On Apr 22, 2:51 pm, Tammy Nejadian <TammyNejad...@discussions.microsoft.comwrote: Do a search in the archives of this NG, look for "wizard" you will find a lot of examples
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.