Hello. I'm trialing the above converter and get a message "Apparently you don't have script object installed". The Microsoft web address advised no longer exists, but i have downloaded the Microsoft Script Control program, but I'm still getting the same error message.
Can you please assist.
We have figured out a solution for this problem, you can download and install Windows Script Control from following URL,
You can also download and install it from following URL directly,
after you installed Windows Script Control, you can run our product to convert PDF files to Excel or PowerPoint formats properly.
if you still have same problem, please feel free to let us know, we will assist you continue.
Windows Script Control
The Microsoft Windows Script Control is an ActiveX control that provides developers with an easy way to make their applications scriptable.
Using the Script Control is merely a matter of adding the control to your program, defining the objects the script programs can access, and then running the scripts as needed.
Before we go any further, I should warn you that using the Script Control is not for everyone. The Script Control is one of the least-documented controls available in Visual Basic. Most of the documentation for MS Script and VBScript was developed for people building web applications. You can incorporate the Script Control into your own programs, but expect to spend some time getting the feel of this control and its quirks. Also, be sure to save your programs (both Visual Basic and VBScript) often.
Microsoft Script Control Overview
The Microsoft Script Control allows the user to write and run scripts for any scripting engine, such as VBScript or JScript, both of which are included with the Script Control. You can add the run-time functionality of any Automation object that exposes methods and properties to the Script Control. By combining the run-time functionality of an application with a scripting engine, you can create a scripting application that runs macros to control the application.
Select a Scripting Language
The first step is to configure the Script Control for the correct scripting language.
pIScriptControl.Language = UCODE$("VBScript")
Other scripting languages can be used by the Script Control.
Add Code to a Procedure
Before you can run the MyTest function, use the AddCode method to add the complete function to the Script Control. If you try to add an incomplete procedure (one with no End Sub or End Function), an error will occur. The following example adds procedure code to the Script Control:
strScript = "Function MyTest" & $CRLF & _
" MyTest = ""Hello this is a test""" & $CRLF & _
You can add arguments to a procedure or function.
strScript = "Sub Multiply(vPrm1, vPrm2)" & $CRLF & _
" Dim result" & $CRLF & _
" result = vPrm1 * vPrm2" & $CRLF & _
" MsgBox result" & $CRLF & _
To pass the parameters, you need to use a safe array.
DIM rgsabound AS SAFEARRAYBOUND
DIM psa AS DWORD
DIM vPrm AS VARIANT
DIM ix AS LONG
' Create a SafeArray with two elements
rgsabound.lLBound = 0
rgsabound.cElements = 2
psa = SafeArrayCreate(%VT_VARIANT, 1, rgsabound)
ix = 0 : vPrm = 20
SafeArrayPutElement(psa, ix, vPrm))
ix = 1 : vPrm = 6
SafeArrayPutElement(psa, ix, vPrm))
Once code has been added using the AddCode method, you can use the Run method to run it.
' Run the script
vRes = pIScriptControl.Run(UCODE$("Multiply"), psa)
Executing Scripting Statements
To execute scripting code, the Script Control features the ExecuteStatement method. For example, the following code executes a MsgBox statement:
' Create a message box with the word Hello in it.
pIScriptControl.ExecuteStatement UCODE$("MsgBox ""Hello""")
Evaluating Scripting Statements
You can also evaluate lines of scripting code using the Eval method. The Eval method simply tests a line of scripting code, as shown in the following example:
pIScriptControl.ExecuteStatement UCODE$("x = 100")
vRes = pIScriptControl.Eval(UCODE$("x = 100"))
MSGBOX STR$(CINT(VARIANT#(vRes))) ' -1 = True
vRes = pIScriptControl.Eval(UCODE$("x = 100/2"))
MSGBOX STR$(CINT(VARIANT#(vRes))) ' 0 = False
Creating an Instance of the Script Control
pIScriptControl = NEWCOM "MSScriptControl.ScriptControl"
It returns the address of a pointer to the ScriptControl object that will be passed as the first parameter of all the methods and procedures of this object.
Using the AllowUI Property
The AllowUI property determines if the scripting engine is permitted to display user interface elements. This can apply to the Script Control itself, such as when it displays timeout messages. It can also apply to scripting engines that use ActiveX scripting interfaces.
pIScriptControl.AllowUI = %VARIANT_TRUE
Using the Error Property
With the Script Control, errors may come from two sources: the Script Control itself, or the script the Control is attempting to run. In the latter case, to debug scripting code, the Script Control features the Error property, which returns a reference to the Error object. Using the Error object, the Script Control can return the number and description of the error, and also the the line number where the error occurs in the script.
The file MSSCRIPT.INC includes a wrapper function called MSScriptControl_GetErrorInfo that calls the Error object and returns an string containing rich error information. You can call it as follows:
IF OBJRESULT THEN
MSGBOX MSScriptControl_GetErrorInfo(pIScriptControl, OBJRESULT)
You can use this function as a template to build your own localized function.
What are difference between wscript.exe and cscript.exe?
In Windows, an executable is either a console application or a Windows application (or a SFU or Native application, but that doesn't matter here).
The kernel checks a flag in the executable to determine which.
When starting using CreateProcess, if it is a console application, the kernel will create a console window for it if the parent process doesn't have one, and attach the STDIN and STDOUT and STDERR to the console.
If it is a Windows application, no console will be created and STDIN, STDOUT and STDERR will be closed by default.
WSCRIPT.EXE and CSCRIPT.EXE are almost exactly identical, except that one is flagged as a windows application and the other is flagged as a console application. (Guess which way around!)
So the answer is: If you want your script to have a console window, use CSCRIPT.EXE. If you want it to NOT have a console window, use WSCRIPT.EXE.
This also affects some behaviors, such as the WScript.Echo command. In a CSCRIPT.EXE this writes a line to the console window. In WSCRIPT.EXE it shows a messagebox.
For your application I suggest CSCRIPT.EXE.