cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to read sheet 2 or higher of Excel file from within Mathcad

Youki
1-Newbie

How to read sheet 2 or higher of Excel file from within Mathcad

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

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:Youki)

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

View solution in original post

3 REPLIES 3
MikeArmstrong
5-Regular Member
(To:Youki)

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

RichardJ
19-Tanzanite
(To:Youki)

Go to "tools", "preferences", and set the script security to low.

Top Tags