4 Replies Latest reply on Nov 16, 2012 1:21 AM by jb_1

    VBA Script !!



      VBA Script !!


           Hi every one;

           I created an excel MAcro with VBA that alow me to export or inject data from an excel sheet to a word template . I can run this "MACRO" every time that I open an excel sheet .
           I expalain whow it works:
           1.File maker export an excel file ( File.xls) with all records a need
           2.Opening the file , the "Macro" will be run and save record of the active row in the template.doc.

           Can I use this "macro" in filemaker ? Or Can I run it from the FileMaker DB??

        • 1. Re: VBA Script !!

               Use the send event script step to open the excel file that contains the macro.

          • 2. Re: VBA Script !!

                 Thank you Phil, evry time I found a help from you; 

                 Please can you expalain to me the concept of your solution wth more details?? How can I mace the "send events script to open excel file??

                 PS; The excel file that I will use to run the macro will be send from the FM server with a scheddle script !!

                 Solution please and thnk you again 

            • 3. Re: VBA Script !!

                   I can't tell you how to set up the Excel file so that the macro runs automatically when the file is opened. I know this is possible because another poster here said that they set up their excel file to do that.

                   Do you know the file name and file path of the excel file?

                   If so, Send Event can be used to refer to a variable with that file path/name to open the excel file. All fileMaker does is open the file.

                   Your script step would look like:

                   Send Event ["aevt" ; "odoc" ; "$path"]

                   Click specify for this step. Select the "file" option and then enter the name of the variable in the dialog that next opens.

                   You might also be able to use Open URL to open the file.

              • 4. Re: VBA Script !!

                     "All fileMaker does is open the file." Can I do with FileMkaerr or File Maker server more than that ??

                     well , I Use Filemaker server with a scheddle script to Export files and send mail with attached file ( file.xls) to users. and my relayy problem here that how can filemaker server run the macro for each xls file exported ?? on my desktop , I create a maccro in a defaulty xls File which run in every xls file opened , .. can I put this macro in the file maker server or runing a script containing this macro ?? thks