Plex 2E

  • 1.  export to grid or as400 table

    Posted Apr 10, 2015 09:26 AM

    I have an excel file with about 7 columns. I need to extract the data from excel and put into a grid or even an AS400 database table, so it can be further manipulated from the 400 later..I see a lot of code for Exporting to Excel but nothing really that reads and then outputs...

     

    Ill continue doing my research and see what I come up and post here...



  • 2.  Re: export to grid or as400 table

    Posted Apr 10, 2015 03:35 PM

    HI Alex

    not sure if you are talking about Plex or 2E applications (I guess it is Plex having categorized your question as CA Plex), but maybe it could be useful for both cases. As you say, we have made some use of writing Excel stuff, but indeed it's possible to read data from Excel. We used java APIs, by using the Apache POI project. Maybe you could get your requirements looking some examples here: Busy Developers' Guide to HSSF and XSSF Features

    We have found that it is possible to work with Excel from java variants.

    But if you are working with WinC variants (and I suppose it's the same working with .NET variants), it is possible to use VBA scripting for both read and write worksheets. We have worked frequently with such APIs. You can get more info from Microsoft (for example, Excel Object Model Overview)

    Hope this helps

    Jorge Ubeda



  • 3.  Re: export to grid or as400 table

    Posted Apr 13, 2015 11:21 AM

    I am using CA Plex. Just looking for some script/code to open the excel file, then copy a range of contents in a workbook to its windows clipboard ? I've read a lot of VBA excel scripts example but when I try running some of them I usually get an object required.

    Eventually when I can get the range contents copied, I'll then be able to paste those contents into my Editable Plex grid.



  • 4.  Re: export to grid or as400 table

    Posted Apr 13, 2015 11:45 AM

    Set objExcel = CreateObject("Excel.Application")

    objExcel.Visible = True

    objExcel.DisplayAlerts = False

    Set objWorkbook = objExcel.Workbooks.Open("PARAMETER")

     

    Set objWorksheet = objWorkbook.Worksheets(1)

    objWorksheet.Activate

    Set objRange = objWorkSheet.UsedRange

    objRange.Copy

     

    objExcel.Application.Quit



  • 5.  Re: export to grid or as400 table

    Posted Apr 14, 2015 06:57 AM

    Solved, Alex?