ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save As Dialog does not prompt for Web File Properties (https://www.excelbanter.com/excel-programming/344871-save-dialog-does-not-prompt-web-file-properties.html)

[email protected]

Save As Dialog does not prompt for Web File Properties
 
I created some VBA code to Save an Excel workbook to a Sharepoint
Document Library.
When I use the file menu to save, after I click Save I am prompted to
enter values for the Web File Properties. Some of the properties are
custom and some are required.

The code below saves correctly but the Web File Properties dialog is
not displayed.

Thanks in advance!

Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Dim sPath As String

Set dlgSaveAs =
Application.FileDialog(FileDialogType:=msoFileDial ogSaveAs)
dlgSaveAs.InitialFileName = "http://hd.netropole.com/kb/Expense
Reports/" & Application.ActiveWorkbook.Name

dlgSaveAs.InitialView = msoFileDialogViewWebView

If dlgSaveAs.Show = -1 Then
sPath = dlgSaveAs.InitialFileName
Application.ActiveWorkbook.SaveAs sPath
End If

End Sub


Patrick Molloy[_2_]

Save As Dialog does not prompt for Web File Properties
 
have you considered using the

Application.GetSaveAsFilename
method?


" wrote:

I created some VBA code to Save an Excel workbook to a Sharepoint
Document Library.
When I use the file menu to save, after I click Save I am prompted to
enter values for the Web File Properties. Some of the properties are
custom and some are required.

The code below saves correctly but the Web File Properties dialog is
not displayed.

Thanks in advance!

Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Dim sPath As String

Set dlgSaveAs =
Application.FileDialog(FileDialogType:=msoFileDial ogSaveAs)
dlgSaveAs.InitialFileName = "http://hd.netropole.com/kb/Expense
Reports/" & Application.ActiveWorkbook.Name

dlgSaveAs.InitialView = msoFileDialogViewWebView

If dlgSaveAs.Show = -1 Then
sPath = dlgSaveAs.InitialFileName
Application.ActiveWorkbook.SaveAs sPath
End If

End Sub




All times are GMT +1. The time now is 03:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com