Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rule only works once..?

3 REPLIES 3
Reply
Message 1 of 4
LSA-skan
285 Views, 3 Replies

Rule only works once..?

I have made this rule, that should fill out a cell in a spreadsheet with a text from IProperties.. but it seem to work only the first time. 2nd time i run it, nothing happends... not even the msgbox at the end...?!

 

Any ideas?

 

GoExcel.Open("I:\TEGNINGSNUMRE SKEMAER\Standard nummer udtagning-test.xlsx", "80000")
'Get new partnumber from Excel'Find next empty row in Column BFor RowPN = 2 To 1000
RowPN = RowPN + 1
If GoExcel.CellValue("B" & RowPN) = 1 Then
'Insert title from open Document
GoExcel.CellValue("C" & RowPN) = iProperties.Value("Summary", "Title")
End If
Next

GoExcel.Save()
3 REPLIES 3
Message 2 of 4
LSA-skan
in reply to: LSA-skan

This actully only works on that one row...! if i remove the text so it is suposed to add iProperties the the cell before, it´s not doing anything either... only Row 43 works, which i find very odd, since im not refering to it anywhere..?!?

 

/LSA

 

EDIT: After adding som more Rows with the number 1 (there should only be a single row with 1 at any one time.) it works for every other row with 1 in it..?!?

 

I realy need some help with this, as im totally blank on whats going on...! O.o

 

/LSA

Message 3 of 4
LSA-skan
in reply to: LSA-skan

ok.. i worked out why it does every other row, apparently the RowPN = RowPN + 1 should not be there... 

 

BUT... now i need the code to stop when it gets to the first Cell containing [1].. as a formula in Excel automatically changes the next cell to become [1]... 

 

Im propably doing this the complete wrong way, but as a rookie im just trying what ever comes to mind, with a mix of what i find on the forum...

 

The optimal code would go in the Excel spreadsheet, find the first empty cell, and put iProperty info there...

 

/LSA

Message 4 of 4
LSA-skan
in reply to: LSA-skan

The code should of course look like this..!

GoExcel.Open("I:\TEGNINGSNUMRE SKEMAER\Standard nummer udtagning-test.xlsx", "80000")
'Get new partnumber from Excel'Find next empty row in Column B
For RowPN = 2 To 1000
If GoExcel.CellValue("B" & RowPN) = 1 Then
'Insert title from open Document
GoExcel.CellValue("C" & RowPN) = iProperties.Value("Summary", "Title")
End If
Next

GoExcel.Save()

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums