excel - Need to save xls workbook As xlsb with VBA -
i use macro create daily report. macro saves xls report xls historically. due large file size want save report xlsb. 2 problems. macro script using run cannot open xlsb file later. message received
"excel cannot open file'rdn activity report.xlsb' because file format or file extension not valid. verify file has not been corrupted , file extension matches format of file.
txtfilename = format(date - 1, "yyyymmdd") activeworkbook.saveas filename:= _ "\\clt-stor01a\ca_services\rdn reports\foruploadprev\rdn activity report." & txtfilename & ".xlsb", _ fileformat:=xlnormal, password:="", writerespassword:="", _ readonlyrecommended:=false, createbackup:=false txtfilename = format(date - 1, "yyyymmdd")
note: need script can open file when file name has date in file name , date of file yesterday's date such "rdn activity report.20150726
"
use saveas
parameter fileformat
:
50
=xlexcel12
(excel binary workbook in 2007-2013 or without macro's, xlsb)51
=xlopenxmlworkbook
(without macro's in 2007-2013, xlsx)52
=xlopenxmlworkbookmacroenabled
(with or without macro's in 2007-2013, xlsm)56
=xlexcel8
(97-2003 format in excel 2007-2013, xls)activeworkbook.saveas "c:\temp\text.xlsb", fileformat:=50
Comments
Post a Comment