Skip to main content
Best answer by terryhendicott

Hi,

 

Save the relevant values to Excel

Prime cannot export "ranges" to Excel you will get an error

Excel knows nothing about units so exporting units to Excel will get an error.

 

Error one is an easy fix. Use an undocumented trick.  If you inline equals after creating a range Prime will turn it into a vector.

For instance in the enclosed screenshot rangeM1 is changed to a column vector

Capture.JPG

 

In the WRITEEXCEL statement simply divide by the units to get values without units exported to excel

Capture2.JPG

The above writes into file a.xlsx the now column vector "rangeM1" into sheet 1 column B starting at row 1

 

You simply need to do this for all the ranges in your sheet saving them to a different column in Excel

 

Cheers

Terry

1 reply

21-Topaz II
October 22, 2022

Hi,

 

Save the relevant values to Excel

Prime cannot export "ranges" to Excel you will get an error

Excel knows nothing about units so exporting units to Excel will get an error.

 

Error one is an easy fix. Use an undocumented trick.  If you inline equals after creating a range Prime will turn it into a vector.

For instance in the enclosed screenshot rangeM1 is changed to a column vector

Capture.JPG

 

In the WRITEEXCEL statement simply divide by the units to get values without units exported to excel

Capture2.JPG

The above writes into file a.xlsx the now column vector "rangeM1" into sheet 1 column B starting at row 1

 

You simply need to do this for all the ranges in your sheet saving them to a different column in Excel

 

Cheers

Terry

21-Topaz II
October 23, 2022

Hi,

To aid understanding of the Excel sheet headings can be added in row one and data started in row two of the excel worksheet

Capture3.JPG

1-Visitor
October 23, 2022

Thank you so much. It is a good solution for my problem.