Hi All,
If I open the spreadsheet and run this code it works perfectly.
If I run it again, excel crashes.
Any idea?
Sub Import()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim MySheetName2 As String
MySheetName2 = Sheets("Main").Range("C37").Value
Dim Importsheet As Worksheet
Sheets.Add Type:= _
"C:\Users\bxr008\Desktop\Volatility Surface\DataFiles\" & MySheetName2 & "_Data.xlsx"
Call CopySheet2
Call Sheets(MySheetName2).Update
Sheets(MySheetName2).Delete
Sheets(MySheetName2 & "_Data").Delete
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Thanks
Bookmarks