All Questions
52
questions
0
votes
0
answers
51
views
Unable to redirect output from VBA with cmd in hidden mode
Am trying to redirect output from cmd to a text file using Wscript.shell script. It works when cmd window is in active mode. But doesn't work with cmd windows style is 0 (hidden mode).
Dim objShell : ...
2
votes
1
answer
503
views
Why does WScript.Shell SpecialFolders function return an empty string for Default and MyDocuments
To facilitate special folder processing, I wrote some code to return requested values based on an Enum with values for DeskTop, Default, MyDocuments, etc. The enum value is then converted to the ...
1
vote
0
answers
696
views
VBA Reconnect Remembered Network Drive
(MS Excel 2016)
I'm trying to find a solution, which can be implemented via vba, to ensure that the network resource for my Excel utility is available and prevent the
{insert path here} is not a ...
2
votes
1
answer
1k
views
WScript.Shell crashes Excel
I am using WshShell to run a batch file from VBA within Excel.
The batch file is VERY simple, one line that runs a number crunching
program. I can run the batch file directly without problems.
I am ...
-1
votes
3
answers
10k
views
VBA - WScript.Shell - Executing A PowerShell Command
I want to execute a PowerShell Command from VBA using WScript.Shell
Here is the string that gets sent to WScript.Shell:
Powershell -ExecutionPolicy Bypass -Command $FilesInPathway = get-childitem -...
1
vote
1
answer
812
views
How to use variables in Wscript.Shell + cmd.exe?
I'm trying to substitute variables to path in a wsh.run command (it should launch a batch file), but I got an error in the dos console: "The file name, directory name or volume label syntax is ...
2
votes
0
answers
535
views
Python script suddenly no longer running when being called by VBA
EDIT: I made an error when posting below in saying that it worked when running from terminal (I must have tested earlier.) This problem was solved by using the python.exe program in the environment (...
0
votes
3
answers
476
views
Msgbox not closing when WSH.Popup waits for certain time
I have an Excel file that opens automatically with Windows Scheduler. Also I have an Auto_Open sub to run a macro immediately. To avoid that every time it opens it starts running without a chance to ...
1
vote
2
answers
798
views
powershell invoke-command exchange mgmt shell from vba with stdout and stderr retrieval and no credential popup
The following requirement(s) I have:
As domain admin user logged on to an administrative client machine
I want to perform some changes on an exchange server using calls
from vba(excel 2013) via ...
0
votes
1
answer
1k
views
Wscript.Quit gives error 424 in VBA for word
I am writing some code in VBA for Word to redirect users to a link if they would like to or to close the window if not using a yes/no box. The problem is that if the user does not want to continue to ...
0
votes
1
answer
2k
views
Excel VBA to start shell script in background with specified environment
I want use an Excel macro to start a python script to run in the background.
I have to be able to specify that it use the system PATH (I don't want to assume where python is installed) as well as a ...
-1
votes
1
answer
280
views
Windows Script Host - Unable to get StdOut from console
I need a hand with a specific doubt regarding VBA, Excel and WSH.
I have a excel that I want to use to run a jar. This jar takes up to 4 seconds to return a anser using System.out.println.
I created ...
0
votes
1
answer
1k
views
Unprotect multiple word documents inside a folder using VBA
I have multiple word documents, which need restrictions imposed on them from Developer mode.
I run the script using wscript passing a folder as argument, But it throes an error
Dim strFolder
Const ...
-4
votes
1
answer
2k
views
Run-time error '429': ActiveX component can't create object in VBA/VBS/WSH
I know it has been asked so many times, but I've gone through dozens of pages, with no luck, since mine seems to be a OS/machine related problem rather then of a specific library.
Trying to manage ...
8
votes
1
answer
12k
views
Opening a File whose Name Contains a Space
I have some simple Excel VBA code that opens non-Excel files like:
Sub scriptTest()
Set objshell = CreateObject("Wscript.Shell")
objshell.Run ("C:\TestFolder\Book1.pdf")
Set objshell = ...