Hi,
I was creating an app. There are 3 output excel sheets writing to the same file. Now all the 3 sheets are coming from 3 separate data streams and are of different structure and schema. I have used block until done tools to force write all 3 sheets into the same file. Now the problem is that the output sheets are not in the expected order. It needs to be arranged in an alphabetical order. But that is not coming as expected. I can't use reporting tools as per requirement.
I was wondering if there is any VBA or batch script which could do the sorting part once the workflow has completed running. We could call this script to do this sorting. But I don’t know VBA, and the only thing which could come up by checking several websites keeps throwing me errors while running it as standalone. Can someone help me to solve the issue?
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("file path") 'insert link or URL to sharepoint document.
Application.ScreenUpdating = False
iSheets = Sheets.Count
For i = 1 To iSheets - 1
For j = i + 1 To iSheets
If Sheets(j).Name < Sheets(i).Name Then
Sheets(j).Move before:=Sheets(i)
End If
Next j
Next i
Application.ScreenUpdating = True
objworkbook.save
objexcel.quit