zak wrote:
> Hi!
>
> I use win32ole to access excel-workbooks.
> When ruby opens a workbook with links to other workbooks an alert box
> pops up and you have to confirm whether you want to keep those links
> or not.
> This is very annoying in my application.
> is there a way to surpress the box and choose "no" by default?
>
> Thanks!
require 'win32ole'
class ExcelConst
# to be filled with all Excelconstants
# once excel is running
end
xl = WIN32OLE.new('Excel.Application')
WIN32OLE.const_load(xl, ExcelConst)
# All Excel constans are now available.
# NB they all start with an uppercase letter.
wb =
xl.workbooks.open("path\\file.xls",UpdateLinks=Exc elConst::XlUpdateLinksNever)
# use XlUpdateLinksAlways for the opposite effect.
# Do stuff
xl.workbooks.close
xl.quit
hth,
Siep
--
Posted via
http://www.ruby-forum.com/.