Jump to content
Sign in to follow this  
mark-b

Script Import of Multiple Excel Worksheets w/o Dialogs?

Recommended Posts

mark-b

We ask customers to fill out and return an excel file and then run a script that imports from multiple worksheets in that file. I can set the "Import Records" script step for the first worksheet in the Excel file with the "Perform without dialog" option checked but cannot do that when importing from subsequent worksheets. I have not been able to find a way to set up the script such that it will import from more than one worksheet in Excel. Setting named ranges in the Excel file seems to suffer the same problem because FMP does not provide an option for storing the names. The end result is my users are forced to click through the FMP import dialog boxes when importing the secondary worksheets which increases the possibility of them causing errors. Does anyone know a work around for this? I am using FMP9 served up from FMS8. Thanks.

Share this post


Link to post
Share on other sites
aaa

Hi, Mark

Use different script steps for each sheet as in attachment.

Share this post


Link to post
Share on other sites
mark-b
Hi, Mark

Use different script steps for each sheet as in attachment.

 

Thanks. I notice in the Import Records script steps the designations for "Sheet1" and "Sheet2". How did you get those in there? I will need to be able to go in and change the worksheet names and I don't see that as a controllable option in FMP9. Are you using FM Advanced or Developer?

 

---------- Added Later ----------

 

OK, after some banging on this I figured out the problem. My Import File script step uses variables to specify the path and file names to the Excel file. As a result, FMP does NOT ask for the specific worksheet you wish to import from when you are creating the script step. I had to add a second explicit path to a real spreadsheet with a bogus name in order to select the specific worksheet I wanted. I then deleted the bogus spreadsheet so now my script uses the variable path/filename AND grabs the right worksheet. Hardly elegant but it seems to work. Thanks for creating and posting the example. Seeing the worksheet names embedded in your example gave me the energy to try to solve this.

 

FileMaker needs to add a directly accessible option to enter in specific worksheet or range names for this script step. Let me know if anyone has any better methods.

Share this post


Link to post
Share on other sites
C3developer

I realize this is a very old discussion (4 years, as I write this) but I have the same need and it appears Filemaker has not yet added the ability in the Import Records script step to directly (or indirectly) specify the specific sheet name desired to import. In my case, I have an Excel workbook with a variable number of sheets I need to import, so I have to create a loop to bring them all in. At least the sheets are named in a consistent fashion so the loop can generate the sheet name. But this thread refers to an "attachment" which I do not see as part of the posted message, and that attachment may contain a clue as to how I can go about scripting my loop, since it helped the original poster. I know how to use a variable to open the file but I need to also specify the specific sheet to be imported ... and am open to suggestions as to how I go about that.

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  



×
×
  • Create New...

Important Information

Terms of Use