Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
1) Can someone tells me how can we read "sheet2" or higher of an excel file directly from mathcad.
For example, I can read an excel file with a commad like READFILE("c:\myfile.xls","excel") but I am getting the sheet1 only.
What should I do to be able to read sheet2 or higher from myfile.xls
2) Yesterday I put a question and I received a correct answer. I cannot find how to set that the question has been correctly answered !
Sorry but I rarely use the PTC community discussion forum
Thank you
Solved! Go to Solution.
The attached scripted component does exactly what you want.
Change the file path to suit your file name - make sure its exactly as your file including the Excel version. Right click the text box click edit script and select the tick at the top. The data should then be extracted as per "Pages" at the top of the sheet.
2) Yesterday I put a question and I received a correct answer. I cannot find how to set that the question has been correctly answered !
Sorry but I rarely use the PTC community discussion forum
I think you select the post where the answer and the site gives you a option to state that the post is the answer.
Mike
The attached scripted component does exactly what you want.
Change the file path to suit your file name - make sure its exactly as your file including the Excel version. Right click the text box click edit script and select the tick at the top. The data should then be extracted as per "Pages" at the top of the sheet.
2) Yesterday I put a question and I received a correct answer. I cannot find how to set that the question has been correctly answered !
Sorry but I rarely use the PTC community discussion forum
I think you select the post where the answer and the site gives you a option to state that the post is the answer.
Mike
Dear all,
The answer below runs well and I can read several sheet from an Excel file.
I am always gettign the security warning asking if I want to disable the evaluation or not.
It is clear that I can answer by hand and have the script running correctly.
The security setting bring me some issues when i am inserting the script in another mathcad file.
I don't know how to remove this security alarm.
Thank you
patrice
Go to "tools", "preferences", and set the script security to low.