i use, in VB6
excelWB.SAVEAS = STRPATH1 & FName & ".XLS" 'FileFormat:=56
to save in 97-2003, i need to add the 'FileFormat:=56?
WORKbOOK SAVEAS format 97-2003
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: WORKbOOK SAVEAS format 97-2003
Yes, but use either
or
NOT excelWB.SAVEAS = ...
Code: Select all
excelWB.SaveAs STRPATH1 & FName & ".XLS", 56
Code: Select all
excelWB.SaveAs Filename:=STRPATH1 & FName & ".XLS", FileFormat:=56
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4334
- Joined: 26 Apr 2010, 17:36
Re: WORKbOOK SAVEAS format 97-2003
HUMMMMM....HansV wrote: ↑17 Apr 2021, 18:06Yes, but use either
orCode: Select all
excelWB.SaveAs STRPATH1 & FName & ".XLS", 56
NOT excelWB.SAVEAS = ...Code: Select all
excelWB.SaveAs Filename:=STRPATH1 & FName & ".XLS", FileFormat:=56
But in vB6 ho to overwrite the exists .xls, without prompt?
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: WORKbOOK SAVEAS format 97-2003
I assume that you create an Excel.Application object. Let's say you have named it excelApp.
Before saving the workbook:
and afterwards:
Before saving the workbook:
Code: Select all
excelApp.DisplayAlerts = False
Code: Select all
excelApp.DisplayAlerts = True
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4334
- Joined: 26 Apr 2010, 17:36
Re: WORKbOOK SAVEAS format 97-2003
HansV wrote: ↑19 Apr 2021, 08:25I assume that you create an Excel.Application object. Let's say you have named it excelApp.
Before saving the workbook:
and afterwards:Code: Select all
excelApp.DisplayAlerts = False
Code: Select all
excelApp.DisplayAlerts = True
WORK FINE