2009-09-18

Opening an Excel file that needs updating

The syntax for this was not obvious to me but is shown here by David Mullet.  So here is a worked example for Excel and updatelinks when opening a spreadsheet.

#----------Open excel sheet that needs updating
require 'win32ole'
xl = WIN32OLE.new('Excel.Application')
xl.Visible = true
#workbook = xl.Workbooks.Open('C:\Flash.xls')
workbook = xl.Workbooks.Open( { 'FileName' => 'C:\Flash.xls', 'UpdateLinks' => 3 } )

No comments: