frenny
7th December 2016, 14:16
Hello ,

here is my code to convert .XLS file to .XLSX file

o.command.line = "/S" & quoted.string("D:\test.XLS")
&" /T" & quoted.string("D:\test_new.XLSX")
& " /F51 /C-4143 /M2"


ret = run.prog( "D:\ConvertXLS.EXE", " " & strip$(o.command.line),
RP_WAIT, "", file.out, file.err)



but execution stops after run.prog command .
This command is perfectly working in command prompt

bhushanchanda
7th December 2016, 14:22
Moved to Tools Development Forum.

Have you tried using RP_NOWAIT? Does the executable have execute permissions set to everyone? Also, does the output file folder have full permissions?

Also, I can see there is no space after "/S" and "/T" which I believe should be there.

frenny
8th December 2016, 06:42
hello,

i have tried all combination , with space ,without space and also with RP_NOWAIT.
but it is not working.
this command is run propertly in command prompt , but with using run.prog it's giving -1 as return value.

oirfeodent
8th December 2016, 09:58
hello,

i have tried all combination , with space ,without space and also with RP_NOWAIT.
but it is not working.
this command is run propertly in command prompt , but with using run.prog it's giving -1 as return value.
Error Code <0 indicates program could not be started.
Code -1 could indicate EPERM or Permission Error.

However, is there any entry in the file.out or file.err?

Regards,

bhushanchanda
8th December 2016, 14:48
Yes. Looks like a permission issue to me as well. You can try adding the executable to a new folder in the D: directory and then try calling it. Also, if that's not working, use cmd full_path_of_program_name parameters and check if that works e.g. this (http://www.baanboard.com/baanboard/showthread.php?t=68282)

frenny
8th December 2016, 14:50
Hello,

i have full access to all the drives, even i have tried the same code with server path but it is not working.
this code is working fine with "start.application.local" but we have to implement this functionality in HTML UI and start.application.local is not working in HTML UI.
and also no such error is coming in error file.

frenny
9th December 2016, 13:19
Hello ,

i have tried same code on server path,but it will goes in infinite loop.
i have also tried with "cmd " but same result .

NPRao
12th December 2016, 20:23
this code is working fine with "start.application.local" but we have to implement this functionality in HTML UI and start.application.local is not working in HTML UI.
Refer to the latest Programmer's guide -
start.application.local()
Syntax:
#include <bic_desktop>

function boolean start.application.local (string commandline, boolean waitFlag, ref long exitCode [, const string verb])

Description

This starts the client application specified in the commandline argument.

Arguments
string commandline This specifies the command that starts the application. If commandline does not include a directory path, Windows searches for the executable file in the following directories, in the order shown below:

The Windows system directory.
The Windows directory.
The directories listed in the PATH environment variable.
This argument may also contain the full pathname of a local document. In this case the application associated with this document extension will be started.

The commandline parameter may one or more times include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of WebUI.

boolean waitFlag Indicates whether the application must wait for the local application to exit.

ref long exitCode Exit code of local application. Only contains a valid exit code when the waitFlag attribute was true

[const string verb] When the commandline argument contains a document pathname, the optional verb argument may contain the action to be performed on this document. The default action is "open". Another useful verb is: "print". In case this argument is supplied, the waitFlag argument will be ignored and the execution will always by asynchronous.

Return values
true Application started successfully.
false Application failed to start.

Context
This function is implemented in the 4GL Engine and can be used in all script types.

Notes
This function is not supported in HTMLUI. See the Implementing HTML UI support for more information.

Implementing HTML UI support
Introduction
As HTMLUI does not support functionality that requires a higher privilege level on the client, some client access functions are not allowed anymore. Calls to these functions have to be replaced with other client access functions which are allowed to be used when running in HTMLUI mode. Also, when a session has fields on its form for specifying a client file or client folder, these fields have to be hidden when running in HTMLUI mode.

unsupported client functions in HTMLUI mode
The following functions are not supported when the client runs in HTMLUI mode:

client2server()
server2client()
create.local.file()
create.local.directory()
dir.select.dialog.local()
get.client.directory()
get.client.hostname()
get.local.filename()
remove.local.directory()
remove.local.file()
seq.fstat.local()
seq.open.dialog.local()
seq.open.dialog.next()
seq.saveas.dialog.local()
start.application.local()
When one of these functions is used while running in HTMLUI mode, the following message appear:

This function is not supported in the HTMLUI WebUI: <function>

HTMLUI client functions
The following functions have to be used when the client runs in HTMLUI mode:

Single file functions:

client.upload.file
client.download.file
client.show.file
Multiple file functions:

client.prepare.download
client.add.download.file
client.start.download
client.upload.files
client.get.upload.filecount
client.get.upload.file
client.delete.upload.file.object
Assisting functions:

get.ui.mode()
tc.is.html.ui()
tc.is.thin.client()
client.get.media.type
When one of the HTMLUI client functions is used while NOT running in HTMLUI mode, the following message appear:

This function is not supported in the WebUI: <function>

oirfeodent
22nd December 2016, 13:28
Hello,

i have full access to all the drives, even i have tried the same code with server path but it is not working.
this code is working fine with "start.application.local" but we have to implement this functionality in HTML UI and start.application.local is not working in HTML UI.
and also no such error is coming in error file.

From HTMLUI, running an "exe" is going to be next to impossible.
The browser framework (used by HTMLUI) does not allow to run an exe(cutable file).

If your baan server is running on a Windows Server, then you can install this "ConvertXLS.EXE" on the server side... Execute the conversion on the server side and directly download the converted file using "client.download.file"... remember to use "get.ui.mode" and build the logic based on that.

Regards,

frenny
23rd December 2016, 08:50
hi all,

Here microsoft words for using runtime creation of new excel exe.

"Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any non-interactive client application".

so currently i have tried other way to fulfil my requirement.

Thank you all for reply
Frenny