VBScript is now called a "legacy programming language" by Microsoft
functions very well; VBScript debugging is no longer supported.
2. You may keep your existing VBScript functions
But install GuiXT version 2019 Q3 3 or above in this
In previous versions GuiXT uses the "Microsoft
browser control" to run the VBcript engine. This browser control can
emulate different Internet Explorer modes IE7 (default) to IE11,
depending on a registry setting "FEATURE_BROWSER_EMULATION" which is
valid for the whole SAP GUI process. If the setting is IE11, VBScript is
not available and your CallVBS statement does not find the called
function. The IE mode of the browser control can be set to IE10 with
But this does not work in a running SAP GUI process if another SAP
function has already set the mode and has created a browser control.
decide to do so, can be accomplished with moderate effort. For example,
Set XL = guixt.CreateObject("Excel.Application")
XL.Visible = True
is changed to
var XL = guixt.CreateObject("Excel.Application");
XL.Visible = true;
There are some caveats:
does not allow access to the local PC, for example to read and
used in a browser connected to the internet and we want to protect
our PC against malicious code.
When called up from GuiXT the
interaction with local files, Excel, Word,... makes sense. This is
possible by creating the right ActiveX object for such actions, for
example "Excel.Application", "Shell.Application", ... Remember
that you need to create them with guixt.CreateObject()
- Some native VBScript string functions are not available in the
substitutes can be implemented, see e.g.
Both choices can make sense, depending on the project type:
- For large projects, VB.NET is the superior language due to its
strict typing, modularity, and rich infrastructure with lots of
for automating Excel or for scripting an embedded HTML page, it is a
reasonable lightweight approach, especially if you are already
- A mixture of both languages (calling each other) is possible but
increases overall complexity
that of a VB.NET call, but both technologies are fast enough for all
normal scripting tasks. We measured an InputScript that
executed 100 000 simple calls, passing two small strings and
returning a small string, on a modern PC (3.6 GHz Intel CPU); this
The difference is mainly due to the fact that calling
.NET from GuiXT requires the transition between a "managed" and
an "unmanaged" environment.
4. VB.NET or C#
Our .NET samples here are mostly written in VB.NET, but it is
completely up to you to use C# instead of VB.NET.
When you translate existing VB code to C#, keep in mind that C# is