What's the best (quickest) way to write to a closed Excel file?
Right now, I'm opening the file and writing to it, but is there a faster way? I don't need to 'read' from the file for any reason.
sCopyName = ThisWorkbook.Path & "\Pricing Tool.xls"
Set Wkb = Workbooks.Open(sCopyName, UpdateLinks:=0)
Workbooks("Pricing Tool").Sheets("Manufacturer Codes").Cells(finalProduct, manCodeCol) = codeTextbox.Value
Workbooks("Pricing Tool").Sheets("Manufacturer Codes").Cells(finalProduct, manNameCol) = manufacturerTextbox.Value
Workbooks("Pricing Tool").Sheets("Manufacturer Codes").Cells(finalProduct, manDescCol) = descriptionTextbox.Value
Workbooks("Pricing Tool").Sheets("Manufacturer Codes").Cells(finalProduct, manPriceCol) = priceTextbox.Value
Workbooks("Pricing Tool").Sheets("Manufacturer Codes").Cells(finalProduct, manInstallCol) = installTextbox.Value
Workbooks("Pricing Tool").Sheets("Manufacturer Codes").Cells(finalProduct, manSearchCol) = searchTextbox.Value
If Val(Application.Version) < 12 Then
'You use Excel 97-2003
Workbooks("Pricing Tool").SaveAs Filename:=sCopyName
Else
'You use Excel 2007
Workbooks("Pricing Tool").SaveAs Filename:=sCopyName, FileFormat:=56
End If
Wkb.Close False
Bookmarks