Try this:
For Each excelsht As Excel.Worksheet In MainWorkbook.Worksheets
excelsht.Copy()
theWorksheet = Objexcel.ActiveSheet
theWorkbook = theWorksheet.Parent
theWorkbook.SaveAs(String.Concat("D:\New Folder\", excelsht.Name, ".xlsx"))
Next
See
Worksheet.Copy Method (Excel)[
^]
[EDIT]
If
Parent[
^] won't work, try this:
For Each excelsht As Excel.Worksheet In MainWorkbook.Worksheets
theWorkbook = Objexcel.Workbooks.Add()
theWorksheet = theWorkbook.Worksheets(1)
excelsht.Copy(Before:=theWorkbook.Worksheets(theWorksheet))
theWorkbook.SaveAs(String.Concat("D:\New Folder\", excelsht.Name, ".xlsx"))
Next