Hi All,
I have gone through a couple of Posts in this very same forum regarding Exporting to Excel over various worksheets,As one of the posts had suggested to add a new function into the Table 370 i.e., Excel Buffer to perform this operation. I have indeed added that function in Table 370 . which is as follows :
AddNewWorksheet( )
XlWrkBk := XlApp.ActiveWorkbook;
XlWrkSht := XlWrkBk.Worksheets.Add( );
Now I have used this function in my report as follows:
TempExcelBuffer.SetUseInfoSheed;
IF Firstexcelsheet THEN BEGIN
TempExcelBuffer.AddNewSheet;
TempExcelBuffer.CreateSheet(“Sheet no. 2”,’’,COMPANYNAME,USERID);
END ELSE BEGIN
TempExcelBuffer.CreateBook;
TempExcelBuffer.CreateSheet(“Sheet no. 2”,’’,COMPANYNAME,USERID);
Firstexcelsheet := TRUE;
END;
TempExcelBuffer.GiveUserControl;
Now,when i run this report the very first excel sheet gets created but then the Execution stops throwing an error like this:
" This Automation Variable has not been instantiated. You can instantiate it by either creating or assigning it"
This error is pointing towards the new function that is called from the table 370, i.e., AddNewSheet.
Can you poeple help me out in this please as i am stuck on this issue for quite some time.
Thank you all in advance,
Prashanth Sanath