So I can get this to work where it exports the XML:
Sub ExportXML()
'
' ExportXML Macro
'
Application.CommandBars.ExecuteMso ("XmlExport")
'
End Sub
And this works, to save the actual Excel doc with a specific predefined place ("C:....") and name (Value from Cell A10) with a time stamp:
Sub SaveMyWorkbook()
Dim vFile As Variant
Dim sCurrDir As String
Dim sName As Variant
Dim strdate As String
sName = [A10] 'value from A1
strdate = Format(Now, "dd-mm-yy h-mm-ss")
' save current directory, and change to desired starting directory
sCurrDir = CurDir
ChDrive "C:\....."
ChDir "C:\....."
vFile = Application.GetSaveAsFilename(InitialFileName:=sName & strdate, _
fileFilter:="Excel files (*.xls), *.xls", _
Title:="My custom save dialog")
If vFile <> False Then
ThisWorkbook.SaveAs Filename:=vFile
Else
MsgBox "Not a valid path" 'cancel
End If
' change back to initial current directory
ChDrive sCurrDir
ChDir sCurrDir
End Sub
But I am hoping to have the export run and for it to save to specific predefined place ("C:....") and name (Value from Cell A10) with a time stamp. Any thoughts?
Thanks!
Bookmarks