granthierry Member Licensed User Longtime User May 15, 2015 #1 hi how to setleftmargin when creating a new sheet ?
Erel B4X founder Staff member Licensed User Longtime User May 17, 2015 #2 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. Upvote 0
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.
granthierry Member Licensed User Longtime User May 17, 2015 #3 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. Upvote 0
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.
Erel B4X founder Staff member Licensed User Longtime User May 17, 2015 #4 You should follow the steps above to create a writable workbook based on an existing xls file. Upvote 0
granthierry Member Licensed User Longtime User May 17, 2015 #5 Erel said: You should follow the steps above to create a writable workbook based on an existing xls file. Click to expand... 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) Upvote 0
Erel said: You should follow the steps above to create a writable workbook based on an existing xls file. Click to expand... 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)
Erel B4X founder Staff member Licensed User Longtime User May 18, 2015 #6 You need to use GetSheet to get the existing sheets. Your code will create new sheets. Upvote 0
granthierry Member Licensed User Longtime User May 19, 2015 #7 Erel said: You need to use GetSheet to get the existing sheets. Your code will create new sheets. Click to expand... thanks i have missed this function getsheet now it work's have a good day Erel Upvote 0
Erel said: You need to use GetSheet to get the existing sheets. Your code will create new sheets. Click to expand... thanks i have missed this function getsheet now it work's have a good day Erel