web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Creating X++ code to import from COMVariant VT_R8 Excel cell to UTCdatetime table field

(0) ShareShare
ReportReport
Posted on by 175

I have a situation where the user will open Form, Batch History and copy all columns and selected rows from there and paste to Excel. I actually want to retain this behaviour.

This step creates a ComVariant VT_R8 field for Excel Column JobStartDateTime.

I now need to be able to read that Excel file and populate a table field that is a UTCdatetime field from JobStartDateTime.

I am struggling. Please help.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Raman,

    Those are loose requirements but you can read and write to an Excel file using SysExcel* classes in AX.  Once you have values read in, you can manipulate however you would like.

    Hope this is a start.  Good luck.

    Kent

  • Raman Profile Picture
    175 on at

    Not sure how loose. I have 15+ years X++ experience. I have been looking at this issue for more than 24 hours. Those with lots of experience and precise knowledge will find this a great challenge.

  • Community Member Profile Picture
    on at

    By "loose" I mean you have not quite defined what you want to do exactly.  You want to be able to capture what a user has copied in their clipboard and then open an Excel worksheet to paste into it?

  • Raman Profile Picture
    175 on at

    Well done. Ok. The exact steps. User opens form Batch job History. User now selects(ticks on left hand tope corner .............why am I saying all this).. I have reread my initial issue and all this will be quite clear if one has enough experience behind you.

  • Suggested answer
    Community Member Profile Picture
    on at

    If you want to simulate selecting all records in a grid, you can use _DS.getnext()

    See here for an example:  daxmusings.codecrib.com/.../multi-select-on-form-datasource-grid.html

    From there, you can store all of your data in a container and then programmatically create an Excel WorkBook to paste the data in.

  • Abhishek_mishra Profile Picture
    405 on at

    Hi Raman,

    VT_R8 irepresents double data type in excel. You can try using FromOADate and ToOADate methods of .net class which converts double value to datetime as excel store date time value as double format also called OLEDB automation date format.

    Hope it helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 34

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans