Solved! Go to Solution.
Solved by MechMachineMan. Go to Solution.
Solved by jdkriek. Go to Solution.
Solved by jdkriek. Go to Solution.
Hi,
It sounds like a question of Excel API only, instead of Inventor API. You may have to consult with Excel. But if you could clarify a bit on "cells are in use", probably some peers here would be able to give some comment.
Hi jdkriek,
Thanks for your reply, please see below for the code im running (very basic).
StartRule: 'read excel file Worksheet=("C:\Workspace\00Vault\ACE-02001- ACE-02500\ACE-02380\ACE-02380-080017") Sheetno= ("Sheet1") GoExcel.Open(Worksheet, Sheetno) For row = 2 To 10000 If GoExcel.CellValue("A" & row) = "" Then GoExcel.CellValue("A" & row) =iProperties.Value("Project", "Part Number") If GoExcel.CellValue("B" & row) = "" Then GoExcel.CellValue("B" & row) =iProperties.Value("Project", "Revision Number") If GoExcel.CellValue("D" & row) = "" Then GoExcel.CellValue("D" & row) =iProperties.Value("Status", "Eng. Approved Date" ) If GoExcel.CellValue("F" & row) = "" Then GoExcel.CellValue("F" & row) =iProperties.Value("Project", "Description") Exit For Next GoExcel.Save
As you will notice there has to be an excel file already saved in the location specified in the 'Worksheet' section of the code...
Any help would be Brilliant!!!
The code you are using really isn't intended to do what you want.
Wrote this real quick, hope it helps.
Worksheet = ("C:\Workspace\00Vault\ACE-02001- ACE-02500\ACE-02380\ACE-02380-080017") Sheetno = ("Sheet1") ' Open excel GoExcel.Open(Worksheet, Sheetno) ' Define Range RowStart = 2 RowEnd = 100 For count = RowStart To RowEnd ' If it's blank count it If String.IsNullOrEmpty(GoExcel.CellValue("A" & count)) Then i = i + 1 End If Next ' Next empty row is max rows minus blank rows plus one row = RowEnd - i + 1 MsgBox("Inserting Data on Row " & row) GoExcel.CellValue("A" & row) = iProperties.Value("Project", "Part Number") GoExcel.CellValue("B" & row) = iProperties.Value("Project", "Revision Number") GoExcel.CellValue("D" & row) = iProperties.Value("Status", "Eng. Approved Date") GoExcel.CellValue("F" & row) = iProperties.Value("Project", "Description") GoExcel.Save
it says "Error on Line 31 : 'row' is a type and cannot be used as an expression". How can I a solve this?
Hi @ulas.deniz
Can you post the code your using to determine what line 31 is?
Thanks. I did it yesterday like you said.