J
jinx_uk_98
Hi Guys,
I have a workbook that, when opened, removes all the defult toolbars
and creates a custom bar on wich I have a button to export the current
select sheet to a location.
the problem is that when this code is run is replaces my custom toolbar
with the defult ones.
any ideas?
thanks
kevin
Sub export()
Application.DisplayAlerts = False
Dim newWks As Worksheet
Dim strdate As String
strdate = Format(Now, "dd-mm-yy")
Sheets("summary").Copy
Set newWks = ActiveSheet
With newWks
..Buttons.Delete
With .UsedRange
..value = .value
End With
..Parent.SaveAs Filename:=ThisWorkbook.Path & "\ " & Range("b2").value &
" " & strdate & ".xls", FileFormat:=xlWorkbookNormal
..Parent.Close savechanges:=False
End With
MsgBox "File successfully exported to " & ThisWorkbook.Path
Application.DisplayAlerts = True
End Sub
I have a workbook that, when opened, removes all the defult toolbars
and creates a custom bar on wich I have a button to export the current
select sheet to a location.
the problem is that when this code is run is replaces my custom toolbar
with the defult ones.
any ideas?
thanks
kevin
Sub export()
Application.DisplayAlerts = False
Dim newWks As Worksheet
Dim strdate As String
strdate = Format(Now, "dd-mm-yy")
Sheets("summary").Copy
Set newWks = ActiveSheet
With newWks
..Buttons.Delete
With .UsedRange
..value = .value
End With
..Parent.SaveAs Filename:=ThisWorkbook.Path & "\ " & Range("b2").value &
" " & strdate & ".xls", FileFormat:=xlWorkbookNormal
..Parent.Close savechanges:=False
End With
MsgBox "File successfully exported to " & ThisWorkbook.Path
Application.DisplayAlerts = True
End Sub