Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some Excel xlDialog advice

Status
Not open for further replies.

itdamon

MIS
Mar 18, 2002
69
US
I need to open 2 dialog boxes to save my workbook to a mapped network drive (X:\ and Y:\)

My first button calls:
Application.Dialogs(xlDialogSaveAs).Show ("X:")

The problem is I want the Dialog box to default to the X: drive and it is not working.

My second button calls:
Application.Dialogs(xlDialogPublishAsWebPage).Show

The problem is I get a run-time error "1004" - Show method of Dialog class failed.

Does anyone know how to make these work? I'm using Excel 2000.
 
I don't think you can do it directly using the built-in dialog. I can recommend two other approaches:

1. Do away with the built-in dialog altogether, use the getsaveasfilename method to allow the user to browse for a filename, and then use activeworkbook.saveas MyFileName to save the book. The argument to GetSaveAsFilename is a filename, or simply a folder, which becomes the default folder.

2. Use ChDrive "X:", then go for the built-in dialog.

As for the publish as web page: it works for me. Are you sure that the active sheet and/or selection are such that the dialog is valid and available?
Rob
[flowerface]
 
I don't think you can do it directly using the built-in dialog. I can recommend two other approaches:

1. Do away with the built-in dialog altogether, use the getsaveasfilename method to allow the user to browse for a filename, and then use activeworkbook.saveas MyFileName to save the book. The argument to GetSaveAsFilename is a filename, or simply a folder, which becomes the default folder.

2. Use ChDrive "X:", then go for the built-in dialog.

As for the publish as web page: it works for me. Are you sure that the active sheet and/or selection are such that the dialog is valid and available?
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top