I have a VBScript that converts Excel files to Tab delimited text files:
format = -4158
Set objFSO = CreateObject("Scripting.FileSystemObject")
src_file = objFSO.GetAbsolutePathName(Wscript.Arguments.Item(0))
dest_file = objFSO.GetAbsolutePathName(WScript.Arguments.Item(1))
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
oExcel.DisplayAlerts = False
oExcel.ProtectedViewWindows.Open(src_file)
oExcel.ActiveProtectedViewWindow.Edit
Dim oBook
Set oBook = oExcel.Workbooks.Open(src_file)
oBook.Worksheets(5).Activate
oBook.SaveAs dest_file, format
oBook.Close False
oExcel.DisplayAlerts = True
oExcel.Quit
In Qt I use wscript to run this code and have connected the signal QProcess::errorOccurred to a lambda:
QObject::connect(&wscript, &QProcess::errorOccurred, [=](QProcess::ProcessError error)
{
qDebug() << "Error has occured";
});
In my VB script, Protected View is removed. However, I modified the script so that it would not disable the protected view. This results in my script not being able to open Excel files that are in protected view, which results in an error saying the Excel file cannot be opened. However, the errorOccured signal is never sent. Why is this happening?