Android Question excel left margin ( resolved )

Discussion in 'Android Questions' started by granthierry, May 15, 2015.

  1. granthierry

    granthierry Member Licensed User

    hi

    how to setleftmargin when creating a new sheet ?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is not possible to set the margin when you create a new sheet. You can however load an existing workbook as a template and then set the cells values.
     
  3. granthierry

    granthierry Member Licensed User

    i don't understand,

    you write :

    Modifying an existing workbook

    As noted above it is not possible to directly modify a workbook file. Instead you need to create a new file that will include a copy of the original workbook.
    This is done by first loading the existing workbook with ReadableWorkbook.

    Then you should create a WritableWorkbook and call Initialize2 instead of Initialize. Initialize2 expects a ReadableWorkbook as the last parameter. It creates a copy of the given ReadableWorkbook.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You should follow the steps above to create a writable workbook based on an existing xls file.
     
  5. granthierry

    granthierry Member Licensed User

    ok ok
    '
    workbook2 have 2 sheets Rapport and Engins

    Dim workbook2 As ReadableWorkbook
    workbook2.Initialize(File.DirAssets ,"rapport_secu_vide.xls")
    '
    Dim workbook1 As WritableWorkbook
    Dim feuille1 As WritableSheet
    Dim feuille2 As WritableSheet

    workbook1.Initialize2(File.DirRootExternal,"rapport_secu.xls",workbook2 )

    the 2 lines above create or reopen the existing sheets ?

    feuille1 = workbook1.AddSheet("Rapport", 0)
    feuille2 = workbook1.AddSheet("Engins", 1)
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    You need to use GetSheet to get the existing sheets. Your code will create new sheets.
     
  7. granthierry

    granthierry Member Licensed User

    thanks i have missed this function getsheet

    now it work's

    have a good day Erel
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice