Wednesday, November 2, 2011

Saving Workbooks

After working on a new workbook, you can save it. After programmatically creating a workbook, if you want to keep it when the

user closes Microsoft Excel or when the computer shuts down, you must save it. You and the user have the option of using the

Save As dialog box.

The Default File Location:-

To support the ability to programmatically change the default folder, the Application class is equipped with a property named

DefaultFilePath. Therefore, to programmatically specify the default folder, assign its string to the

Application.DefaultFilePath property. Here is an example:

Private Sub Exercise()

Application.DefaultFilePath = "C:\chidambaram\document and settings\my documents\"

End Sub

When this code has executed, the Default File Location of the Excel Options dialog box would be changed.

No comments: