9 Replies Latest reply on Mar 25, 2009 7:50 AM by TSGal

    Import from Excel

    Dasher

      Title

      Import from Excel

      Post

      Does anyone know of a way to import two or more worksheets from the same Excel file without having to open the file after each worksheet import? I want to be able to open the file and import data from two different worksheets into two different tables in Filemaker 9.0. Thanks

        • 1. Re: Import from Excel
          deltatango
             Are you using the file import menu item? You might want to try dragging the excel file onto the Filemaker Icon. I don't know if this would be different.
          • 2. Re: Import from Excel
            philmodjunk
              

            Not really.

             

            The closest approximation of this that I can come up with is to script it. But then you're still doing it twice, you're just having the script do these two imports in automatic succession for you.

            • 3. Re: Import from Excel
              Dasher
                 Thanks. That's pretty much what I do now. I use a script to import the first worksheet then have it import the second, but I still have to select the Excel file between the first and second import. I've tried, without any luck, to come up with a better way.
              • 4. Re: Import from Excel
                philmodjunk
                   I gather that it's not the same file name each time. Best fix I can think of is to rename your excel file so that it always has the same name and always resides in the same folder. (You could rename and place copies of your file in a designated folder for example.) Then your scripted import could import the data without ever asking for a filename.
                • 5. Re: Import from Excel
                  Dasher
                     Unfortunately, renaming the file is not an option but thanks.
                  • 6. Re: Import from Excel
                    philmodjunk
                       Please note that I suggested renaming a copy of your excel file rather than renaming the orignal. That approach can preserve the filenames of your originals. Some savvy developers may have a batch file (windows) or Applescript that can automate the process.
                    • 7. Re: Import from Excel
                      comment_1
                        

                      You could have users select the file to import by using the Insert File script step. Use a global container field as the target, and pre-select 'Store only as reference'.

                       

                      Once you have the reference to the file in the container, you can extract the path using GetAsText (gContainerField), place it into a variable and proceed with the imports.

                      • 8. Re: Import from Excel
                        philmodjunk
                          

                        Comment,

                         

                        I like what I am reading but...

                         

                        Once I have the file path in a field, how do I use that field in a script that imports data from the file?

                        • 9. Re: Import from Excel
                          TSGal

                          PhilModJunk:

                           

                          Since "comment" hasn't responded, I thought I should jump in before more time passes.

                           

                          Once you have the file path in a field, store the contents of that field into a variable.  For example:

                           

                          Set Variable ( $path ; "file:" & <fieldname> ]

                           

                          Then, in the Import Records script step, where you specify the data source, use $path.

                           

                          TSGal

                          FileMaker, Inc.