0
I am wanting to generate a CSV file from the data of 3 columns, but they presents me an error, could help me?
Follows code below:
Sub GravaTXT()
Dim wbkExport As Workbook
Dim shtToExport As Worksheet
Dim name As String
name = Range("R13").Value
Set shtToExport = ThisWorkbook.Worksheets("Orcamento")
ActiveColumn.Range("B").Select
ActiveColumn.Range("M").Select
ActiveColumn.Range("R").Select
Set wbkExport = Application.Workbooks.Add
shtToExport.Copy Before:=wbkExport.Worksheets(wbkExport.Worksheets.Count)
Application.DisplayAlerts = False
wbkExport.SaveAs Filename:="C:\Users\alcir.scarmin\Desktop\" & name & ".csv", FileFormat:=xlCSV
Application.DisplayAlerts = True
wbkExport.Close SaveChanges:=False
End Sub
Which error?
– Isac
It presents me "Error 424 the object and mandatory"
– Mateus Bodanese
On which line is this error shown ?
– Isac
Resolved, thank you!
– Mateus Bodanese