Working With Worksheets

Ex ra

The FileFormat parameter accepts any of the XlFileFormat constant values, as outlined in Appendix A. The list of available file formats is rather extensive. Typically, you save the worksheet in another workbook by specifying the xlWorkbookNormal constant. This constant creates a new workbook based upon the default workbook format for the current version of Excel. If you need to save the workbook in a format to be used by an earlier version of Excel, you need to specify the appropriate format parameter. For example, xlExcel5 saves the workbook in a format that can be opened by Excel 5.0 or later.

As specified, the Password and WriteResPassword parameters provide two different types of protection for the new workbook. The Password parameter protects the workbook from being opened. In other words, you must specify the correct value for the Password parameter to open the workbook containing the sheet. You can employ the WriteResPassword parameter with or without the Password parameter to indicate the password that must be specified to modify the workbook. If the user types a password that does not match the one specified by the WriteResPassword parameter, the workbook opens as read-only and the user cannot modify it.

Type FileName: = "NameofFile", replacing NameofFile with the name and path to save the file.

□ Type FileFormat:=xlHtml, replacing xlHtml with the format in which you want to save the file.

■ The current sheet is saved in the specified format.

Type FileName: = "NameofFile", replacing NameofFile with the name and path to save the file.

□ Type FileFormat:=xlHtml, replacing xlHtml with the format in which you want to save the file.

■ The current sheet is saved in the specified format.

0 0

Post a comment