ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Upload Excel-files in AS400 with VBA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upload Excel-files in AS400 with VBA

    Hello,
    I have to upload different Excel-files in AS400.
    I can not use the Excel add-in to transfer data to AS400.
    I have only a Client Acess option to connect to AS400( V5R3).
    How can i create a VBA-macro that :
    1- open an xls-file on the C-drive
    2- make a connection to AS400 (prompting for UserId + Password)
    3- if file on AS400 not exists, create the PF based on the Xls-file
    If file on AS400 exists, replace the content of it
    4- transfer the content of the xls-file to the PF on AS400

    Can someone point me out how to do this ?

    Thanks for any reply.

  • #2
    Re: Upload Excel-files in AS400 with VBA

    Have you looked at using CPYFRMIMPF command ?

    Comment


    • #3
      Re: Upload Excel-files in AS400 with VBA

      Check also:
      All-in-one import / export tool IBM i (iSeries, AS/400) to Excel and Excel to IBM i. High security, off-the-shelf product administered by your IT department

      Comment


      • #4
        Re: Upload Excel-files in AS400 with VBA

        Here is a model that I picked up somewhere on the web. I have been playing with a copy of it and have got it to work on my system.

        Hummm. Looks like this site will not allow me to upload a .xls.
        Last edited by Denny; June 7, 2008, 09:12 AM. Reason: Upload attachment failed.
        Denny

        If authority was mass, stupidity would be gravity.

        Comment


        • #5
          Re: Upload Excel-files in AS400 with VBA

          Lets try again.

          Also should have read your request more carefully. This is an Excel VBA program, so it will not work as a CA macro.

          Take a look at "Use PCOMM Scripts to Dynamically Build a Spreadsheet, Part 2.

          In Part 1 of this series, I demonstrated that users of IBM‘s Personnel Communications can use VBScript to run a remote PC command right from the 5250 emulator window. I want to build on that short tutorial by demonstrating how to build an Excel spreadsheet right from the context of the current 5250 screen. First
          Attached Files
          Last edited by Denny; June 7, 2008, 09:29 AM. Reason: Second thoughts
          Denny

          If authority was mass, stupidity would be gravity.

          Comment


          • #6
            Re: Upload Excel-files in AS400 with VBA

            THanks Arrow483 and Denny for your responses

            I first like to know HOW i can set up from VBA Excel a connection with the AS400-system.
            What have i to do on AS400-side and what have i to do on the Excel-side ?

            Thks

            Comment


            • #7
              Re: Upload Excel-files in AS400 with VBA

              Hey JPDO, look at the article and the txt file. It has it all.
              Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

              Comment


              • #8
                Re: Upload Excel-files in AS400 with VBA

                HI,
                What means "setting up a System-DSN" ?

                Comment


                • #9
                  Re: Upload Excel-files in AS400 with VBA

                  That's ODBC. If I were you, I would use OLE DB instead of ODBC. Can you get your hands on the iSeries Access for Windows installation CD? You should install the OLE DB driver that comes with that.
                  "Time passes, but sometimes it beats the <crap> out of you as it goes."

                  Comment


                  • #10
                    Re: Upload Excel-files in AS400 with VBA

                    Thanks for your answer, Littlepd.
                    Can i check anywhere if the OLE DB-driver is already installed ?
                    Using VB-scripts make troubles for me: when I will start the script-code i can not give up where those code is located. In can simply not key-in something and i think those things are forbidden on the system.
                    So I first need to know what's necessary on the I-series before i start to code in VBA.

                    Comment


                    • #11
                      Re: Upload Excel-files in AS400 with VBA

                      Originally posted by JPDO View Post
                      So I first need to know what's necessary on the I-series before i start to code in VBA.
                      Nothing (I think)

                      The database and a TCP/IP is all you should need to enable remote OLE DB access.

                      For more info, see "A Fast Path to AS/400 Client/Server Using AS/400 OLE DB Support".
                      "Time passes, but sometimes it beats the <crap> out of you as it goes."

                      Comment

                      Working...
                      X