this is my first post, I'm a SysAdmin that recently took over the position, the previous person that had the job has retired and I really don't know how to contact him, so i have to figure everything out myself.
The problem that i have is the following, there's one scheduled task that we have in one of our W2K8 R2 boxes, this task basically just calls a .vbs (script) that queries AD then puts the output in Excel and sends an email to a few people with the excel file as an attachment, we recently upgraded our Office suite to 2013 from 2010 (about 4 months ago).
We were not aware that the report was not being sent out, until one of the people that usually review it, contacted us and ask for the report, I wen to check the Log of the scheduled task but it doesn't log any errors, then while reviewing the log of the script I noticed that after the routine that performs the query to ad has retrived all the information and tries to put all in the excel spreedsheet something happens and it suddently stops, there's just one error logged, see next line :
Microsoft Excel: Sort method of Range class failed
I honestly think that the recent upgrade to 2013 did something and that's why is not generating the report, but I would like to get a second opinion, from people with more expirence in VB and Excel.
The piece of code that i think adds the info to excel is the following :
'sortthedetailssheet
'
Set objRange=objSheetDetails.columns("A:D").EntireColumn
Set objRange2=objSheetDetails.Range("C1")
Set objRange3=objSheetDetails.Range("A1")
objRange.Sort objRange2, xlAscending, objRange3, , xlDescending, , , xlYes
'
'sorttheMembershipsheet
'
Set objRange=objSheetMembership.columns("A:C").EntireColumn
Set objRange2=objSheetMembership.Range("A1")
Set objRange3=objSheetMembership.Range("B1")
objRange.Sort objRange2, xlAscending, objRange3, , xlAscending, , , xlYes
I would appreciate any suggestions, since I'm very new to vba and think is going to take me a while get up to speed.