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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Import .CSV / .XLS which is specified by string

ArneClaußen
1-Newbie

Import .CSV / .XLS which is specified by string

Hello Guys

is ist possible to specify the path of an file( which i want to import with the components shown in the attached jpg) by a string.

It would be nice to have the path somewhere in the mathcad-file saved, and the components use that string..

So that I dont have to use the ***** menu of the components!?

I hope you understand by poor english

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:ArneClaußen)

I think I have found the problem. I don't think the function likes the .csv at the end of the page name. Try removing it and re-running the component.

Remember once the component has turned red you will have to right click, edit script, and click apply (tick sign)

Mike

View solution in original post

15 REPLIES 15
MikeArmstrong
5-Regular Member
(To:ArneClaußen)

is ist possible to specify the path of an file( which i want to import with the components shown in the attached jpg) by a string.

It would be nice to have the path somewhere in the mathcad-file saved, and the components use that string..

Have a look at the attached worksheet, which uses a scripted component where range and sheet number can be specified within Mathcad.

Mike

Looks fine, but i get an error-message.

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

Make sure the path is correct. Can you upload both worksheets.

Mike

The Path is correct, but i cant upload the sheets.

Do I need Mathcad 15?

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

What version of Mathcad and Office do you have.

Have a look at the image below, the component works.

Try right clicking on the component, edit script and click the tick (Apply)

Clipboard01.jpg

Mike

I use Mathcad 14 and office 2003

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

The component works with M14 and Excel 2003. It the file path, sheet name or cell range must be incorrect.

Can you take a screen shot of the Mathcad sheet where the file path and range is defined.

Mike

Here you are.

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

Have you saved both of the files to your hardrive? I have had that problem before.

Make sure the Excel sheet is not open when you run the component.

Mike

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

I think I have found the problem. I don't think the function likes the .csv at the end of the page name. Try removing it and re-running the component.

Remember once the component has turned red you will have to right click, edit script, and click apply (tick sign)

Mike

Yes you are right, thanks for the script and for your support.

Best regards,

Arne

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

Yes you are right, thanks for the script and for your support.

No problem at all.

Mathcad 15 has a nice feature built in which eliminates the need for the scripted component, but for now I think your stuck with it.

Mike

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

Would you be able to check if the ReadExcel function at the bottom of this sheet works similar to the scripted component. It works perfectly with M15 and Excel 2007, but I would like to see it's behavior with M14 and Excel 2003.

Cheers

Mike

Please excuse my late answer,

no it does not work, Mathcad says he cant find the function getobject (line 16)

Greetings

MikeArmstrong
5-Regular Member
(To:ArneClaußen)

no it does not work, Mathcad says he cant find the function getobject (line 16)

Ok cheers.

No worries it was just to satisfy my own curiosity.

Mike

Top Tags