ivankokan / Excel2LaTeX

The Excel add-in for creating LaTeX tables
Other
1.27k stars 147 forks source link

Cannot save to file in OneDrive folder #33

Open Tom866 opened 3 years ago

Tom866 commented 3 years ago

The plugin is not able to save the generated table when the Excel file exists in a OneDrive folder.

When clicking the 'Save to File' button:

Run-time error '52'
Bad file name or number

When I click on debug, it open a MS VBA debug window at the 'memento' module and highlights the line of Open sFilename .... in

If pModel.Encoding = Application.DefaultWebOptions.Encoding Then
        Open sFileName For Output Access Write Lock Read Write As #1
        Print #1, sCodePageRemark
        Print #1, pModel.GetConversionResult;
        Close #1

It has to do with the fact that a OneDrive folder is handled as a sort of network drive instead of a real folder. When clicking the browse button of Excel2Latex is opens at:

https://xxx-my.sharepoint.com/personal/xxx/Documents/xxx/LaTeX/Tab

I do not know VBA, but a few lines above the one I just posted there is a line:

sFileName = pModel.AbsoluteFileName

With this information, it might be easy to solve this issue. On the other hand, it is easy to live around this issue caused by the severe integration of the MS365 suite in Excel.