iLogic. Return a formated cell (Date) in a messagebox

iLogic. Return a formated cell (Date) in a messagebox

Anonymous
Not applicable
613 Views
7 Replies
Message 1 of 8

iLogic. Return a formated cell (Date) in a messagebox

Anonymous
Not applicable

I would like a messagebox to show the date that is written in a cell (A1) in excel.It does however return me some nonsense numbers, as if my cell wasnt formated. I would like it to read it as a date. I would appreciate any help!

 

SyntaxEditor Code Snippet

Dim a As String 
a=GoExcel.CellValue("myfile.xlsm", "mydocument", "A1")

when i display A1 in a messegebox i get the unformated value of the cell

 

 

0 Likes
614 Views
7 Replies
Replies (7)
Message 2 of 8

johnsonshiue
Community Manager
Community Manager

Hi! If possible, could you attach an example spreadsheet here? It is better to try on the exact file you are working on.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 8

Anonymous
Not applicable

unfortunately i cant do it, but ill try to create a dummy file and replicate the problem. I would simply creata a cell that contains a date and than id create an ilogic file where i assign the cell a variable (type string) and tell a textbox to show that string. Instead of showing the date, it shows unfomated cell content (if you select a date in excel and change the format to standard, zou get the same nonsense numbers). It means ilogic reads the unformated content, which is my problem,  since the date is a format

0 Likes
Message 4 of 8

marcin_otręba
Advisor
Advisor

Sorry but i don't think you will accomplish it thru ilogic.. vba or addin without problem.. maybe another approach is to change excel and not to use formatted text and treat it like text (and write date as text) ?

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 5 of 8

Anonymous
Not applicable

thanks for the answer. However i need these cells to stay formated as a date becouse they are being used in vba code and are connected.I hope someone knows a trick or something 😕

0 Likes
Message 6 of 8

marcin_otręba
Advisor
Advisor
Can write you VBA code for that if you want.. Just need to know what you want to accomplish...

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 7 of 8

Anonymous
Not applicable

well the whole purpose of my work is to create that Messegebox in iLogic to show its capabilities 🙂 so the VBA would not help me i think, but thanks for the offer

0 Likes
Message 8 of 8

marcin_otręba
Advisor
Advisor

Although i think that ilogic is worst choice, there you go:

 

Dim a As String 
a=GoExcel.CellValue("myfile.xlsm", "mydocument", "A1")

myDate = Date.FromOADate(a)
MessageBox.Show(myDate, "Title")

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes