Message 1 of 11

Not applicable
03-01-2016
10:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
in the below code, in loop condition, two excel files are readen but it gives me error for second loop and stop. It just work for second loop...
Any one has any idea??
Sub Main() GoExcel.Open(ThisDoc.Path & "\" & "Nozzles.xlsx", "Sheet1") kk=1 For j=1 To 10 GoExcel.FindRowStart = kk+1 i = GoExcel.FindRow(ThisDoc.Path & "\" & "Nozzles.xlsx", "Sheet1", "RadialNozzle", "=", "true","class","=",150,"flangeType","=",0) If i<>-1 Then kk=i aa= GoExcel.CurrentRowValue("nominalDiameter") MessageBox.Show("Message" & aa, "Title") MessageBox.Show("Message" & kk, "Title") Dim sFilePath As String= ThisDoc.Path & "\" ThisDoc.Save doc = ThisDoc.Document sNewName=GoExcel.CellValue("B" & i) 'GoExcel.Close'Next j'GoExcel.Open("C:\Users\Ali Khakbaz\Desktop\nozzle\WNFLG2.xlsx", "Sheet1")'i = GoExcel.FindRow("C:\Users\Ali Khakbaz\Desktop\nozzle\WNFLG2.xlsx", "Sheet1", "NPS", "=", aa) i = GoExcel.FindRow(ThisDoc.Path & "\" & "WNFLG2.xlsx", "Sheet1", "NPS", "=", aa) MessageBox.Show("Message" & i-1, "Title",MessageBoxButtons.OK) Lenght= GoExcel.CurrentRowValue("O") RuleParametersOutput() GoExcel.Close ThisDoc.Document.Update() ThisDoc.Document.saveas(sFilePath & sNewName & ".ipt",True) End If Next j ThisApplication.ActiveView.Fit End Sub
Solved! Go to Solution.