XLL+ Class Library

CXlMacros::SaveAs

Equivalent to choosing the Save As command from the File menu

[C++]
static int SaveAs(
   const char* document_text,
   short int type_num = 1,
   const char* prot_pwd = 0,
   short int backup = -1,
   const char* write_res_pwd = 0,
   short int read_only_rec = -1
);

Parameters

document_text

Document_text specifies the name of a workbook to save.

type_num

Type_num is a number specifying the file format in which to save the workbook.

prot_pwd

Prot_pwd is the password, as text, required to unprotect a protected file.

backup

Backup is a logical value corresponding to the Always Create Backup File check box in the Save Options dialog box. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

write_res_pwd

Write_res_pwd is the password, as text, required to open a read-only file with full write privileges.

read_only_rec

Read_only_rec is a logical value corresponding to the Read-Only Recommended check box in the Save Options dialog box. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

Return value

Zero if the function has been called successfully; non-zero if the function could not be called. See Error codes for a list of return values.

Remarks

See the Microsoft Excel on-line Help for full details about this function.

Requirements

Header: xlfuncs.h

See Also

CXlMacros Class | CXlMacros Methods