I have an excel template with password protected VBA.If i try to save, it will not allow unless i enter the password.I tried to write a VBA which will create a copy of current excel object and save it in a new location(by throwing save as dialoge control). But stil, since VBA is password protected, it is not possible to do so.So now i am trying to create a new XL application,workbook and copy the
current worksheets to new workbook.I am trying the following code.But it is throwing 'type mismatch'.
Dim xlApp As Excel.Application
Dim xlbook As Excel.Workbook
Set xlApp = CreateObject("Excel.Application"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
xlApp.Workbooks.Add
Set xlbook = xlApp.ActiveWorkbook
Application.ActiveWorkbook.Sheets(0).Copy before:=xlApp.Workbooks(xlbook).Sheets(0)
current worksheets to new workbook.I am trying the following code.But it is throwing 'type mismatch'.
Dim xlApp As Excel.Application
Dim xlbook As Excel.Workbook
Set xlApp = CreateObject("Excel.Application"
xlApp.Workbooks.Add
Set xlbook = xlApp.ActiveWorkbook
Application.ActiveWorkbook.Sheets(0).Copy before:=xlApp.Workbooks(xlbook).Sheets(0)