Hi guys,
help me with this cause i'm totally freaking out
the error is probably very stupid but i can't find it
i spent two hours looking everywhere
i simply wrote a macro that deletes (hopefully) a sheet in another workbook
here's the code:
the macro doesn't return any error, everything seems fine but when i open the VF IT 07-13 Giugno 2010.xls the sheet is still there!!
ideas?
Thanx in advance!!
help me with this cause i'm totally freaking out
the error is probably very stupid but i can't find it
i spent two hours looking everywhere
i simply wrote a macro that deletes (hopefully) a sheet in another workbook
here's the code:
Code:
Sub aaa()
Dim excelApp As Excel.Application
Dim sampleWbk As Workbook
Dim wshDelete As Worksheet
Dim path As String
path = "C:\Documents and Settings\Visiant\Desktop\estrazione settimanale\VF IT 07-13 Giugno 2010.xls"
Set excelApp = CreateObject("Excel.Application")
Set sampleWbk = excelApp.Workbooks.Open(path)
'Set sampleWbk = excelApp.Workbooks.Open("C:\Documents and Settings\VF IT 07-13 Giugno 2010.xls")
Set wshDelete = sampleWbk.Worksheets("Supporto")
Application.DisplayAlerts = False
wshDelete.Delete
Application.DisplayAlerts = True
sampleWbk.Save
sampleWbk.Close
End Sub
ideas?
Thanx in advance!!