Em xin hỏi nội dung như sau :
Sub tao_wb_new()
Dim wb As Workbook
Set wb = Workbooks.Add
Dim mypath As String
mypath = Application.FileDialog(msoFileDialogSaveAs).Show
wb.SaveAs Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1)
End Sub
With Application.FileDialog(msoFileDialogSaveAs)
.Show
If .SelectedItems.Count > 0 Then
ActiveWorkbook.SaveAs Filename:=.SelectedItems(1), _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
Else
MsgBox ("No File Selected")
End If
End With
với fileDialog Save As bạn thực hiện theo code trên nhé.
Lỗi của bạn là thiếu ở cấu trúc SaveAs, cần xác định loại file (FileFormat)
cảm ơn thầy