can anyone tell me where the extra number come from ?(ilogic)

can anyone tell me where the extra number come from ?(ilogic)

Darkforce_the_ilogic_guy
Advisor Advisor
636 Views
5 Replies
Message 1 of 6

can anyone tell me where the extra number come from ?(ilogic)

Darkforce_the_ilogic_guy
Advisor
Advisor

My code look like this 

ExcelPath  = "C:\Working Folder\CAD\Kallesoe\Kallesoe iLogic\Underdevelopment\ProjectRequirements.xlsx"
	ExcelSheet = "Ordre"
	Dim NameList As New ArrayList()
	
	
	
	GoExcel.Open(ExcelPath, ExcelSheet)
	For i = 3 To 4
		NameList.Add(NameList.Add(GoExcel.CellValue(ExcelPath, ExcelSheet, "A"& i)))
	'MessageBox.Show(NameList.Add("Raw")), "Title")	
	'MessageBox.Show(GoExcel.CellValue(ExcelPath, ExcelSheet, "A3"), "Title")
Next 


	'NameList.Add(GoExcel.CellValue(ExcelPath, ExcelSheet, "A3"))
	GoExcel.Close
	Dim msg As String
	msg = ("Surface needed - Select Surface " & vbLf & "Part Numner: "+iProperties.Value("Project", "Part Number")& vbLf & "Description: "+iProperties.Value("Project", "Description")& vbLf & "Title: "+ iProperties.Value("Summary", "Title")& vbLf).ToString






	d0 = InputListBox(msg, NameList, d0, Title := "Info - Surface needed", ListName := "Surface")

 

I only thing there should come an inputlistbox with 2 linje .. but 4 it coming and the 0 and 2 should not be there as far as i now. can anyone tell me why they are there ? and how to fix it 

 

 

Anmærkning 2020-04-26 084911.png

0 Likes
637 Views
5 Replies
Replies (5)
Message 2 of 6

NachoShaw
Advisor
Advisor

without bit more info its hard to say but at a very top level first glance, are you adding 2 rows per call?

NameList.Add(NameList.Add(GoExcel.CellValue(ExcelPath, ExcelSheet, "A"& i)))

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 3 of 6

Darkforce_the_ilogic_guy
Advisor
Advisor

the cell does not ...but the cell that I an use to as main title does. can it still be that and is the a way it not show thoes extra nummer and still keep the titles ?

0 Likes
Message 4 of 6

NachoShaw
Advisor
Advisor

how are you adding the list to NameList to the Listbox? You are adding 2 entries on that code line and whatever code you use to populate the listbox is just showing the NameList array. If you only want to show the titles, why dont you just add the titles only?

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 5 of 6

WCrihfield
Mentor
Mentor

Maybe try replacing the '+' plus signs in your msg with '&' signs?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 6

Curtis_Waguespack
Consultant
Consultant

Hi @Darkforce_the_ilogic_guy 

 

I'm not sure I understand what it was doing, but this version gave me the expected list.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

ExcelPath  = "C:\Working Folder\CAD\Kallesoe\Kallesoe iLogic\Underdevelopment\ProjectRequirements.xlsx"
ExcelSheet = "Ordre"
Dim oNameList As New ArrayList()

For i As Integer = 3 To 4
	'MsgBox(i)
	oValue = GoExcel.CellValue(ExcelPath, ExcelSheet, "A"& i)
	'MsgBox(oValue)
	oNameList.Add(oValue)
Next 

Dim msg As String
msg = ("Surface needed - Select Surface " & vbLf & _
"Part Numner: " + iProperties.Value("Project", "Part Number") & vbLf & _
"Description: " + iProperties.Value("Project", "Description") & vbLf & _
"Title: " + iProperties.Value("Summary", "Title") & vbLf).ToString


d0 = InputListBox(msg, oNameList, d0, "Info - Surface needed", "Surface")

GoExcel.Close
	

EESignature