Notifications
Clear all

Código para fechar arquivo do Excel - Macro

1 Posts
1 Usuários
0 Reactions
1,566 Visualizações
 Eron
(@eron)
Posts: 103
Estimable Member Admin
Topic starter
 

Segue exemplo:

        'Objetos do Excel
        Set oExcel = CreateObject("Excel.Application")
        oExcel.Visible = False
        oExcel.DisplayAlerts = False
        
        Set oWkb = oExcel.Workbooks.Add
        Set oWkb = oExcel.Sheets.Add
        oWkb.Name = NomePasta
        
        
        Application.DisplayAlerts = False
        
        oWkb.SaveAs Filename:=arqFatME, FileFormat:=xlExcel8
        
        Application.DisplayAlerts = True
        
        oExcel.Quit
        Set oWkb = Nothing
        Set oExcel = Nothing
        ActiveWorkbook.Save
        MsgBox "coloque a mensagem que você quer ", vbInformation, "Informação"
 
Postado : 17/09/2011 5:57 am