Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have the following code, which does what I want it to do, but is there a way to write it so that I can do one line of the 'component.add' code and it finds all the cells in the excel sheet that contain data and insert them all without having to specify the row number?
Dim sFile As String = "C:\VaultWorkspace\Designs\PROJ Skiold\Personlige\KPK\"& cstr (iProperties.Value("Project", "Part Number")) & " DK250S Config.xlsx" GoExcel.Open(sFile, "Test") Dim FirstCol = "A" Dim FirstRow = "2" Dim componentA = Components.Add("" , "CO_D" & CStr(GoExcel.CellValue(sFile, "Test", FirstCol & FirstRow)) & ".ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing) Dim componentB = Components.Add("", "CO_D" & CStr(GoExcel.CellValue(sFile, "Test", FirstCol & (1+FirstRow))) & ".ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing) Dim componentC = Components.Add("", "CO_D" & CStr(GoExcel.CellValue(sFile, "Test", FirstCol & (2+FirstRow))) & ".ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing) Dim componentD = Components.Add("", "CO_D" & CStr(GoExcel.CellValue(sFile, "Test", FirstCol & (3+FirstRow))) & ".ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing)
Solved! Go to Solution.