# Printing problems with 'spreadsheet' gem

**URL:** <https://www.ruby-forum.com/t/printing-problems-with-spreadsheet-gem/157929>\
**Category:** Ruby\
**Created:** [January 16, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/printing-problems-with-spreadsheet-gem/157929 "2009-01-16T17:06:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jimb](https://www.ruby-forum.com/u/jimb)\
**Post date:** [January 16, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/printing-problems-with-spreadsheet-gem/157929/1 "2009-01-16T17:06:33Z")

</div>

Hi,  
I’m using the ‘spreadsheet’ gem to generate a number of invoices  
automatically.  
In itself that works great, but when I come to print the files I have  
generated I get the error message “Microsoft Excel did not find anything  
to Print”.  
Has anyone else run up against this problem and does anyone know how to  
get round it.  
Oh, and by the way, I also generated a one cell Excel file thus:

require ‘spreadsheet’  
Spreadsheet.client\_encoding = ‘UTF-8’  
book = Spreadsheet::Workbook.new  
sheet1 = book.create\_worksheet  
sheet1[0,0] = ‘Hello’  
book.write ‘C:/Dokumente und Einstellungen/Jim/Desktop/new.xls’

and still had the same problem.  
This was just to check I hadn’t done something weird in my code.

---

<div class="post-metadata">

**Author:** ![jimb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jimb](https://www.ruby-forum.com/u/jimb)\
**Post date:** [January 16, 2009, 7:30pm UTC](https://www.ruby-forum.com/t/printing-problems-with-spreadsheet-gem/157929/2 "2009-01-16T19:30:19Z")

</div>

Jim,

On Fri, Jan 16, 2009 at 5:05 PM, Jim B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,  
> I’m using the ‘spreadsheet’ gem to generate a number of invoices  
> automatically.  
> In itself that works great, but when I come to print the files I have  
> generated I get the error message “Microsoft Excel did not find anything  
> to Print”.  
> Has anyone else run up against this problem and does anyone know how to  
> get round it.

Yup, that was a known problem until a couple of days ago. Fixed in  
0.6.3.

hth

best,  
Hannes

---

<div class="post-metadata">

**Author:** ![jimb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jimb](https://www.ruby-forum.com/u/jimb)\
**Post date:** [January 16, 2009, 7:54pm UTC](https://www.ruby-forum.com/t/printing-problems-with-spreadsheet-gem/157929/3 "2009-01-16T19:54:17Z")

</div>

Hi Hannes,

I updated the gem and now it works like a charm.  
Thanks a million.

Jim.

P.S. One more question I have regarding the spreadsheet gem - how do you  
apply a thick border to a cell?

format = Spreadsheet::Format.new :color =\> :black, :weight =\> :bold,  
:size =\> 12, :align =\> :left, :border =\>1

will just give you a thin border.  
I tried increasing the number, stipulating :thick as a parameter, but no  
joy
