0

I have to change few cell values in .xlsm file in ruby, I used roo gem for the same. I am able to set the value for the specific cell however I am not able to save the changes. Below is the details on what I have tried so far,

 workbook = Roo::Spreadsheet.open '#{filename}.xlsm 
    sheet_name = workbook.sheet(#{sheet_name})
    value =  sheet_name.set(5, 6, 8000,  nil)
    sheet_name.row(5)

When I read the 5th row value , I can see that the 5th row 6th column is been updated as 8000, but I am not able to save these changes.Can someone please suggest what needs to be done in this case, if not through 'roo' gem how can I modify the cell values of existing .xlsm file in ruby?

Swapna
  • 1
  • 1

1 Answers1

0

Roo implements read access for all common spreadsheet types.

Is the the first line in the README of the Gem. It is there to read data, not write XLSX files.

Have a look at this answer, it lists various libraries, two that can do read and write: https://stackoverflow.com/a/42953808/2037537

Roland Studer
  • 4,315
  • 3
  • 27
  • 43