0

I have a SAS Code where inside we have embedded the VB script, While trying to execute the code through sas application i am getting an error stating like subscript out of an error, at the following block of code

With oExcel
.Sheets(1).ListObjects.Add 1, .Sheets(1).Range(sRange), , , "Tableau1"
.Sheets(1).ListObjects("Tableau1").TableStyle = "TableStyleLight2"
   .Sheets.Add .Sheets(1)
   .Sheets(1).Range("B1").VerticalAlignment = -4160
   Set ZGPPict = .Sheets(1).Range("B2").Worksheet.Pictures.Insert(ZGPPicture)
   For iRowAdd = 1 To 6
       .Sheets(1).Rows("1").EntireRow.Insert
   Next

We tried applying the solutions but it doesn;t work

  • Which line throws the error ? Is the ListObject created at all? Does it have the name `Tableau1` (which implies that you are using a french Excel)? I guess the `"Tableau1"` parameter for the `ListObjects.Add`-command is wrong, it set's the TableStyle, not the name of the ListObject. – FunThomas Mar 01 '23 at 09:52

0 Answers0