B4J Question Problem with Initialization of PoiWorkbook

Zvi

Member
Licensed User
Hi, I'm trying to use PoiWorkbook but when the program gets to the line "wb.InitializeExisting(File.DirApp,"","B4J Excel.xlsx",False)" I get the following error:
"java.io.FileNotFoundException: C:\Users\zviba\OneDrive\Desktop\B4JEXC~1\Objects (Access is denied)"

The excel file is not password-protected.

I would really appreciate some help :)

B4X:
'Non-UI application (console / server application)
#Region Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
#End Region

Sub Process_Globals
    Private xl As XLUtils
End Sub

Sub AppStart (Args() As String)
    CreateWorkBook2
    StartMessageLoop 'non-ui app
End Sub

Sub CreateWorkBook2 As ResumableSub
    Dim wb As PoiWorkbook
    If File.Exists(File.DirApp,"B4J Excel.xlsx") Then
        wb.InitializeExisting(File.DirApp,"","B4J Excel.xlsx",False)
    End If
    StopMessageLoop 'non-ui
End Sub
 

Zvi

Member
Licensed User
Hi walt61, thank you for your suggestion.
I paused OneDrive and tried running the code again... same problem.
To be certain, I transferred the code (incl. all directories) to a folder that is not covered by OneDrive. Same problem ?‍♂️
 
Upvote 0
Top