Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

Ilogic Get date from excel to Custom Property

Ilogic Get date from excel to Custom Property

j.romo
Advocate Advocate
1,017 Views
5 Replies
Message 1 of 6

Ilogic Get date from excel to Custom Property

j.romo
Advocate
Advocate

We have a Project Excel sheet that goves us the delivery time to finish a Project that our PM fills with some dates for each Project we are currently developing.

I have the next code but the date on the spreadsheet comes back as numbers in the custom Iproperty, 

the custom iprop does not get any value if I set it as Date, and gives me random numbers if I set it up as Text.

We search the row by Project name

SyntaxEditor Code Snippet

Dim oPROJ As String
Dim oDATE As String

oPROJ = iProperties.Value("Project", "Project")
'oDATE = iProperties.Value("Custom", "DEADLINE")

GoExcel.Open("X:\ILOGIC\PROJECT_TEST.xlsx", "CURRENT")

For rowPR = 3 To 100

If (GoExcel.CellValue("A" & rowPR) = oPROJ) Then

 oDATE =  GoExcel.CellValue("B" & rowPR)

iProperties.Value("Custom", "DEADLINE")= oDATE


Exit For

End If

Next
GoExcel.Save
GoExcel.Close

 

0 Likes
Accepted solutions (1)
1,018 Views
5 Replies
Replies (5)
Message 2 of 6

dgreatice
Collaborator
Collaborator
Accepted solution

Change this line :

 

iProperties.Value("Custom", "DEADLINE")= Date.FromOADate(oDATE)
Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 3 of 6

j.romo
Advocate
Advocate

Hello dgreatice

Didnt work, even changing the custom property to date or text.

found a work around , In the Spreadsheet the cells have to be as text for the code to work.

Thanks a lot

0 Likes
Message 4 of 6

dgreatice
Collaborator
Collaborator

Hi,

 

 

I create that code with date type in data excel, not a text type. and my iProperties  is date value, and its work for me.

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 5 of 6

j.romo
Advocate
Advocate

Thats weird

I can Share the IPT file and the XLSX file

if you want to take a look?

0 Likes
Message 6 of 6

dgreatice
Collaborator
Collaborator

Yes, if no confidential.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes