4 Replies Latest reply: Apr 8, 2012 8:53 AM by vansul RSS

    ole2.set_property(worksheet,'Zoom',75); is not working in forms 6i

    928469
      All,

      I am not able to set the excel worksheet zooming size to 75% by using ole2.set_property(worksheet,'Zoom',75);
      even by using the above it is generating the excel worksheet with 100% zoom.

      Please suggest me alternative solution to resolve this issue.

      reg,
      Guptaj
        • 1. Re: ole2.set_property(worksheet,'Zoom',75); is not working in forms 6i
          vansul
          create an arglist and add argumetns as 75 to that then

          ole2.set_property(worksheet,'Zoom',arglist);
          it will work
          • 2. Re: ole2.set_property(worksheet,'Zoom',75); is not working in forms 6i
            928469
            Hi,

            I tried in the above scenario, but no use.....

            here is the code i am using.....

            Procedure OpenWorksheet(Worksheetname varchar default NULL) is
            Begin      
                      --Open Excisiting Excel Sheet
                 If Worksheetname is not null Then           
                 Arg := ole2.create_arglist;
                 ole2.add_arg(Arg,Worksheetname);
                 WorkSheet := ole2.get_obj_property(Workbook,'WorkSheets',Arg);
                 ole2.add_arg(Arg,70);
                 ole2.set_property(WorkSheet,'Zoom',Arg);
                 ole2.destroy_arglist(arg);
                 Else
                      Arg := ole2.create_arglist;
                      ole2.add_arg(Arg,70);
                      WorkSheets := ole2.get_obj_property(Workbook,'WorkSheets');
                      Worksheet := ole2.invoke_obj(Worksheets,'Add');
                      ole2.set_property(WorkSheet,'Zoom',Arg);
                      ole2.destroy_arglist(arg);
                 End If;
            End OpenWorksheet;


            stiil no use....
            • 3. Re: ole2.set_property(worksheet,'Zoom',75); is not working in forms 6i
              vansul
              in vbscript there is not option for worksheet to zoom for 75%.
              Actually this is not problem of ORACLE
              its problem of writing your VBS
              • 4. Re: ole2.set_property(worksheet,'Zoom',75); is not working in forms 6i
                vansul
                Use
                Windows instead of worksheet as window has the zoom property of variant type.
                so you need to get window and then set zoom to 75
                ----
                Procedure OpenWorksheet(Worksheetname varchar default NULL) is
                excelObj ole2.obj_type;
                wbooks ole2.obj_type;
                wbook ole2.obj_type;
                windows_obj ole2.obj_type;
                window_obj ole2.obj_type;
                Begin
                Arg := ole2.create_arglist;
                ole2.add_arg(Arg,75);
                excelobj:=ole2.create_obj('excel.application');
                wbooks:=ole2.get_obj_property(kexcel,'worksheets','1');
                wbook := ole2.invoke_obj(Worksheets,'Add');
                window_obj:=ole2.get_obj_property(kexcel,'windows','1')
                ole2.set_property(window_obj,'Zoom',Arg);
                ole2.destroy_arglist(arg);
                ole2.destroy_arglist(arg);
                ole2.release_obj(kexcel);
                exception when others then
                var=ole2.last_exception(vars);
                message(vars);
                End OpenWorksheet;