B4J Question B4j xlutils create file Excel

mauriegio

Member
Licensed User
Longtime User
Hello at all,

i created a file excel in B4j with library xlutils, but when open the file with Excel, he tell me "error the format and the estension not correspond.
the file i corrupt ecc..."

but if i answer yes if i want to open the file the same all is ok.

What can i do ?

Thank you very much

Maurizio
 

mcqueccu

Well-Known Member
Licensed User
Longtime User
Show your code or upload small project how you are creating the file
 
Upvote 0

mauriegio

Member
Licensed User
Longtime User
hello thanks mcqueccu,

i created excel file with the follow code :

Private xl As XLUtils

xl.Initialize
Dim wb As XLWorkbookWriter = xl.CreateWriterBlank
Dim sheet As XLSheetWriter = wb.CreateSheetWriterByName("Dati")
Dim TitleStyle As XLStyle = wb.CreateStyle

Dim LockStyle As XLStyle = wb.CreateStyle.Locked(True)
Dim NoLockStyle As XLStyle = wb.CreateStyle.Locked(False)
Dim VerticalStyle As XLStyle = wb.CreateStyle.VerticalAlignment("CENTER")
Dim RightStyle As XLStyle = wb.CreateStyle.HorizontalAlignment("RIGHT")
Dim TestoAcapoStyle As XLStyle = wb.CreateStyle.WrapText(True)
Dim NumericoStyle As XLStyle = wb.CreateStyle.DataFormat("#,##0")

sheet.PutString(xl.AddressZero( 0 ,CntTgl) , Ar_Excel.product_reference).SetStyles(sheet.LastAccessed, Array(VerticalStyle,LockStyle))

sheet.xl.CreateWriterPassword = "mauri"

wb.SaveAs(TmpDir, "FileOut.xls", True)

Help me if you can

thank you very much

Maurizio
 
Upvote 0
Top