is it possible to read in the tags of the sheets in an excel work sheet? I'd like to populate a list box with the tags so that I can choose by clicking which sheet I wish to read in.
Has anybody some VB code that might be useful?
Thanks in advance
Solved! Go to Solution.
yes. The several sheets within one Excel file (i.e. tabs) are labelled sheet 1 to... Quite often I get Excel files with measurement data where these names have been altered (e.g. temp. reading 11...) so that I need to open the excel file in order to get the tab names. Any automation process on this task would help.
Knew that you'd answer first 😉
This sort of works, have a look.
I cannot find the code to do it fully automated, but this is a work around. I have used the function below within the excel worksheet to extract the tab name, and then called into Mathcad. It would mean whoever creates the Excel file doing a little extra work.
Have a look at both of the attached and let me know what you think.
thank's for the effort. I have a problem however with ActiveX. This is the error message I get when invoking your script
that works. Let's see whether I get the guys down in the basement to write down the tags on the first page.
They shouldn’t have to do anything extra. The second example is fully automated. All you need to do is select the Excel workbook and the scripted components should do the rest.
I have encountered an error when opening the file (both files are saved to the desktop). Mathcad 15 M010.
P.S. Can be it is necessary to use in a script a relative path for file Excel?
I have this anoying problem I can't solve. Your code worked fine, but when I copied it into another drop list (in order to choose the tabs from that list) it refused to work.
Can you have a look at the attached MC 15 sheet and check what's wrong?
Thanks in advance
Sorry for the late reply. I am currently traveling across Europe and don't have Internet access, except in the Hotel.
I'll have a look later for you.