3

I have a model flow that allows a user to input an excel worksheet which then converts a sheet within the wksht to a table and joins that table to a feature class. Currently, the Excel to Table tool I am using will only convert the sheet within the worksheet that is either the first sheet in the list in the worksheet or will convert the particular sheet that is specified by a name in the tool. My issue is, there is no standard naming convention for the particular sheet that will need to be converted and one excel workbook can have multiple sheets within. I only want one particular sheet within the wkbk to be converted to a table and would Ideally like the user to be able to select that sheet. Is there any way to allow user input on this? Here is an image of my current model below:

enter image description here

enter image description here

Where the Sheet(optional) input is, I would like the user to be able to select the appropriate sheet but I cannot make this a model parameter.

  • 1
    Why can't you make the sheet input a parameter? – Hornbydd Oct 6 '16 at 18:42
  • You should be able to use Python to get all Sheet names and present to the user in a Listbox or other control. The use can then select the appropriate sheet. – klewis Oct 6 '16 at 22:06
  • Thanks for the response klewis, I figured it out using the Table to Table tool but using the python route sounds like a good option too I'm just not as savvy in that area. – Dom B Oct 6 '16 at 22:28
4

As Hornbydd commented, why can't you make the sheet a model parameter? This can be done with the Excel to Table tool in ModelBuilder.

In ModelBuilder, right-click on the Excel to Table tool in your model, and select Make Variable > From Parameter > Sheet

enter image description here

This will add Sheet as a variable to your model. You can now right-click on that Sheet variable and select Model Parameter

enter image description here

This will add the P in the model to indicate a parameter

enter image description here

And you will get the Sheet parameter as a drop down when you run your model.

enter image description here

1

I figured it out. Using the Table to Table tool (in the Conversion toolbox) allows the user to select the specific sheet in the excel workbook that needs to be joined to the respective feature class. You have to set an output location so I have just used the %scratchGDB% since I do not need to keep the resulting db table. Seemed to do the trick. I have included an image below for any others who have this issue.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.