I am able to import Excel sheets into global tables no problem.
I would like to then use "Post Import Code" to scan the newly populated global table for numeric strings that contain a percent sign.
If a percent sign is in an Excel cell as a result of being pasted (like, someone pasting 3.141% into Excel), MTEI will import it as a flush-left string "3.141%" versus it being a fractional value 0.03141 (which would then have correctly shown up up in the global table as a true number, flush right).
Interestingly, if the data in the Excel cell is originally 0.3141 and AFTERWARDS you do a Format Cells in Excel to display it in the Excel cell as a percent 3.141%, then FlexSim still brings it in correctly as 0.3141.
This difference in how the original Excel cell's data was created (pasted, versus Format Cell), has tripped us up numerous times. So, we thought we'd just do some simple data cleansing on the FlexSim side by scanning a just-imported global table for 1) a percent sign character "%" suffix on any string in a global table cell, then 2) determine if everything to its left is either a numeral, with or without the decimal point. In which case, we can assume with some confidence that it's actually a percentage value (like 3.141%) even though represented as a string inside the FlexSim global table.
When these percent values are discovered, we can then (I think) do some simple string-to-number conversion in FlexScript (in the Post Import Code) and re-write the fractional percent value back into the same global table cell as truly numeric 0.03141, i.e., the true fractional percent value.
The other solution of course, is to ban our own use of percent signs in the source Excel sheet. However, there's no guarantee that someone might do it anyway in the source Excel sheet (because in this application, the input Excel sheets for MTEI are created by humans). Thus, some light data cleansing is in order - we just need the name of the table that was just populated by the MTEI so we can scan it for percent symbols. I searched the Forum and the FlexSim manual, but didn't see a way the table's nodename is getting passed to the OnImport code. Note that we will likely only import one table at a time (Post Import Code I believe is executed after 1 or more tables is loaded).
Thanks, Mike - Goodyear