3 Replies Latest reply on Jun 29, 2017 2:28 PM by planteg

    Opening FMP server DB from VBA

    brianb

      hello,

       

      Hate to bother everyone again but google searching yields no results.

       

       

      Problem:  I

       

      1) have a VBA script (excel) to call and open filemaker -> delays to account for window update-> then runs FM script to import. Worked perfectly fine until the FM file was moved from a Local Network to a FM server.   I have updated the VBA to include FM server location (IP & filename), but it can no longer open the DB file.   Not exactly sure the reasoning and I assume it has to do with the FMserver setup

                          i have tried various formats of the location such as  "\\255.255.255.255\FileName"   "fmp:\\255.255.255.255\FileName", forwards slashes etc...

       

      2) In addition, my  FM import script can no longer import on the first try.  The import file is set up so  with a static name/location within a temporary folder located on the local network drive. After a few error prompts and manually selecting the file location it will import and continue with the script as normal. However, It takes a min of two attempts at selecting the same import csv file.

       

       

      to help understand the workflow:   excel-> user clicks macro button -> macro generates  temp csv file -> opens fm -> calls fm script to import from that csv.      It worked when everything was hosted on local, but now that it is been migrated to FMserver it doesn't agree with the scripting

        • 1. Re: Opening FMP server DB from VBA
          planteg

          Hi,

           

          in the Excel VBA routine, do you get an error ? Did you check in FMS log if someting appears ? If so you get a clue at why the file did not open.

           

          And did yoy check the command line arguments filemaker.exe accepts ? You may for example invoke FilleMaker in your script with the database as an argument if possible. I also read, but never tried, that there is an FM object you could link to, an OCX object.

          • 2. Re: Opening FMP server DB from VBA
            wimdecorte

            The command line arguments won't work but FM does have an ActiveX interface that you can call to open files.  Do a search for ActiveX in the FM help for examples.  Those examples are actually written in VBA.

            • 3. Re: Opening FMP server DB from VBA
              planteg

              In FMP16 Help, ActiveX refers to the knowledge base. From there I found an example of VBA coding in Japanese or something that looks like Japanese to me.

               

              I searched on filemaker.com and found examples for FMP12 and 13. For 15, again it refers to the knowledge base. For 12, it states to add a reference to the FileMaker Library without naming it. Oh, the example seems to refer to VB and not VBA. I may have missed something.