Skip to main content

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
If you type offer the source and d'nt make a mistake, then I think the solutions is @ before quit.

Tel us the result.

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
With MODIFY olExcel @Quit(), I don't see any changes.
Excel just stays in memory.

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
With MODIFY olExcel @Quit(), I don't see any changes.
Excel just stays in memory.

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
Originally posted by Hans

...


Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?


Chances are, a dialog box pops up. Try to execute with VISIBLE = 1 and see if this is the case.

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
This is the routine I use. Even with VISIBLE = 1, Excel stays in memory.

      *
       CREATE-EXCEL-FILE.
           PERFORM CREA-EXCEL00 THRU CREA-EXCEL99.
       CREA-EXCEL00.
           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
      * Tabel in Excel plaatsen
           MODIFY olWrkSh Range("A2")::Resize(TELLER, 8)::Value =
                  EXCEL-TABEL.

      * Kolommen verbreden
           MODIFY olWrkSh @Range("A1")::ColumnWidth = 24,
                          @Range("B1")::ColumnWidth = 24,
                          @Range("C1")::ColumnWidth = 3,86 ,
                          @Range("D1")::ColumnWidth = 15,14 ,
                          @Range("E1")::ColumnWidth = 8 ,
                          @Range("F1")::ColumnWidth = 8 ,
                          @Range("G1")::ColumnWidth = 9 ,
                          @Range("H1")::ColumnWidth = 51,57.

      * Font naar Arial 8
           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 7.

      * Pagina Setup
           MODIFY olWrkSh @PageSetup::TopMargin    = 0,
                          @PageSetup::BottomMargin = 0,
                          @PageSetup::LeftMargin   = 0,
                          @PageSetup::RightMargin  = 0,
                          @PageSetup::Orientation  = xlLandscape.

      * Font & kleur & kader hoofding veranderen
           INQUIRE olWrkSh @Range("A1:H3") IN olRange.
           MODIFY olRange @Font::Bold = 1.
           MODIFY olRange @Interior::ColorIndex = 15.
           MODIFY olRange @Interior::Pattern = @xlSolid.
           MODIFY olRange @BorderAround(@xlContinuous, @xlThin,
      -                       @xlColorIndexAutomatic).

      * Formaat kolom G veranderen
           INQUIRE olWrkSh @Range("G1") IN olRange;
           MODIFY olRange @ENTIRECOLUMN::@NUMBERFORMAT('###.###.##0,00').

      * Kolom E, F, G rechts uitlijnen
           INQUIRE olWrkSh @Range("E3:G3") IN olRange;
           MODIFY olRange @HorizontalAlignment=xlHAlignRight.

      * Hoofding in ander kleur zetten
           INQUIRE olWrkSh @Range("A1:H3") IN olRange
           MODIFY olRange @Font::ColorIndex = 9
           MODIFY olRange @Font::Bold = 1

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel @Quit().
           DESTROY olExcel.
       CREA-EXCEL99.
      *


[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
You do get a whole lot of olRange wich you simply overwrite. I suggest you may try to destroy the ranges before you get a new one into the same variable.

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
You do get a whole lot of olRange wich you simply overwrite. I suggest you may try to destroy the ranges before you get a new one into the same variable.

[Migrated content. Thread originally posted on 25 January 2006]


           CREATE APPLICATION OF Excel HANDLE IN olExcel.
           MODIFY olExcel Workbooks::Add() GIVING olWrkBk.
           INQUIRE olWrkBk Worksheets::Item(1) IN olWrkSh.
     
           ......

           INQUIRE olWrkSh @Range("A1:H1000") IN olRange.
           MODIFY olRange @Font::Name = "Small Fonts",
                          @Font::Size = 6.

           ......

           DESTROY olRange.
           DESTROY olWrkSh.
     
           MODIFY olWrkBk @SaveAs(BY NAME @Filename WBESTAND)
           MODIFY olWrkBk @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY olExcel Quit().
           DESTROY olExcel.



Using this code, everything works just fine except for Excel to stay in memory.

Any ideas what can be forgotten ?
Thanks Ghisle, that's the trick.