Pergunta

By default a cell in MS Excel has format "number". If you put value '2/2' to a cell Excel converts it to date. How to change the format of cell to Text using 'win32ole'? I want to put '2/2' and see exactly '2/2'. When I talking about 'win32ole' I mean http://ruby-doc.org/stdlib-1.9.3/libdoc/win32ole/rdoc/WIN32OLE.html

Foi útil?

Solução

I have found the answer. I looked for 'change cell format using VBA'. So the answer: cell.NumberFormat = '@'

Pretty not obvious.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top