I'm generating Excel using the Excel 11 Object Library as in:
It works fine and I can generate an Excel report with the titles formatted as black on grey.
The customer wants AutoFilter set as on by default though, and I can't seem to find how to do this.
Iv'e tried 'xlWorkSheet.AutoFilter = True' but I get an error saying this is read only, so this is obviously not the way to assign the value just determine it.
xlWorkSheet.Range("$A1").AutoFilter() seems the most likely way to set Iv'e found but this gives System.Runtime.InteropServices.COMException: AutoFilter method of Range class failed and I can't determine why. Iv'e tried various types of ranges such as ("$A1:$IV1") but no joy.
Can anyone advise on this?
Also if anyone knows a good reference for this sort of programming (VB.Net generation of Excel) would be grateful
Thanks
Andy
It works fine and I can generate an Excel report with the titles formatted as black on grey.
The customer wants AutoFilter set as on by default though, and I can't seem to find how to do this.
Iv'e tried 'xlWorkSheet.AutoFilter = True' but I get an error saying this is read only, so this is obviously not the way to assign the value just determine it.
xlWorkSheet.Range("$A1").AutoFilter() seems the most likely way to set Iv'e found but this gives System.Runtime.InteropServices.COMException: AutoFilter method of Range class failed and I can't determine why. Iv'e tried various types of ranges such as ("$A1:$IV1") but no joy.
Can anyone advise on this?
Also if anyone knows a good reference for this sort of programming (VB.Net generation of Excel) would be grateful
Thanks
Andy