WORKbOOK SAVEAS format 97-2003

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

WORKbOOK SAVEAS format 97-2003

Post by sal21 »

i use, in VB6

excelWB.SAVEAS = STRPATH1 & FName & ".XLS" 'FileFormat:=56

to save in 97-2003, i need to add the 'FileFormat:=56?

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: WORKbOOK SAVEAS format 97-2003

Post by HansV »

Yes, but use either

Code: Select all

excelWB.SaveAs STRPATH1 & FName & ".XLS", 56
or

Code: Select all

excelWB.SaveAs Filename:=STRPATH1 & FName & ".XLS", FileFormat:=56
NOT excelWB.SAVEAS = ...
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: WORKbOOK SAVEAS format 97-2003

Post by sal21 »

HansV wrote:
17 Apr 2021, 18:06
Yes, but use either

Code: Select all

excelWB.SaveAs STRPATH1 & FName & ".XLS", 56
or

Code: Select all

excelWB.SaveAs Filename:=STRPATH1 & FName & ".XLS", FileFormat:=56
NOT excelWB.SAVEAS = ...
HUMMMMM....

But in vB6 ho to overwrite the exists .xls, without prompt?

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: WORKbOOK SAVEAS format 97-2003

Post by HansV »

I assume that you create an Excel.Application object. Let's say you have named it excelApp.

Before saving the workbook:

Code: Select all

excelApp.DisplayAlerts = False
and afterwards:

Code: Select all

excelApp.DisplayAlerts = True
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: WORKbOOK SAVEAS format 97-2003

Post by sal21 »

HansV wrote:
19 Apr 2021, 08:25
I assume that you create an Excel.Application object. Let's say you have named it excelApp.

Before saving the workbook:

Code: Select all

excelApp.DisplayAlerts = False
and afterwards:

Code: Select all

excelApp.DisplayAlerts = True
:cheers: :clapping:
WORK FINE