[Solved] Execute .vbs file using macro in Calc
-
- Posts: 27
- Joined: Fri Jun 17, 2022 9:45 am
[Solved] Execute .vbs file using macro in Calc
Please advise how to run or execute (.vbs) file using calc macro
(.bat) file ruining very well using below code, but (.vbs) file not running
SysShell.Execute(ABC.bat,CmdString,0)
(.bat) file ruining very well using below code, but (.vbs) file not running
SysShell.Execute(ABC.bat,CmdString,0)
Last edited by Lovepreet323 on Mon Nov 11, 2024 2:31 pm, edited 1 time in total.
OpenOffice 4.0 on Windows 10
Re: Execute .vbs file using macro in Calc
The .bat files requests the operating system only, but - I suppose it - the .vbs files requests some Visual Basic interpreter.
https://stackoverflow.com/questions/690 ... xecute-vbs
https://stackoverflow.com/questions/690 ... xecute-vbs
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Execute .vbs file using macro in Calc
Be sure that soffice process has sufficiant rights to run .vbs script.
Especially if you're running functions on the operating system.
Especially if you're running functions on the operating system.
OpenOffice 4.1.12 - Windows 10
-
- Posts: 27
- Joined: Fri Jun 17, 2022 9:45 am
Re: Execute .vbs file using macro in Calc
How to give rights to soffice to run .vbs file
OpenOffice 4.0 on Windows 10
Re: Execute .vbs file using macro in Calc
You must launch your VBscript in Elevated mode
Ask to your prefered MS forum
But for me, this is an XY problem. Why using an external program?
OpenOffice 4.1.12 - Windows 10
-
- Posts: 27
- Joined: Fri Jun 17, 2022 9:45 am
Re: Execute .vbs file using macro in Calc
I made a vbs script to download a file from web in hidden mode without using any browser. Because i unable hide downloding from browser
OpenOffice 4.0 on Windows 10
Re: Execute .vbs file using macro in Calc
... if it is just about downloading a file I would recommend to use OOBasic rather than VBS
Code: Select all
oSimpleFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess")
oSimpleFileAccess.copy("https://www.google.de", "C:\users\martin\downloads\google.html")
-
- Posts: 27
- Joined: Fri Jun 17, 2022 9:45 am
Re: Execute .vbs file using macro in Calc
Please provide complete macro code of above example
OpenOffice 4.0 on Windows 10
Re: Execute .vbs file using macro in Calc
For information: many examples of suitable macro code for OpenOffice and LibreOffice, together with an informative discussion on such programming are in the works of Andrew Pitonyak, which may be downloaded free from his site at
https://www.pitonyak.org/oo.php
https://www.pitonyak.org/oo.php
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
Re: Execute .vbs file using macro in Calc
This is the complete code. You just have to replace the target web file you want to download and the target storage location
(and add sub main / end sub)
(and add sub main / end sub)
-
- Posts: 27
- Joined: Fri Jun 17, 2022 9:45 am
Re: Solved **Execute .vbs file using macro in Calc
Thanks all above who helped me. It's working very well
OpenOffice 4.0 on Windows 10
-
- Posts: 27
- Joined: Fri Jun 17, 2022 9:45 am
Re: [Solved] Execute .vbs file using macro in Calc
Please help me to solve one more issue to download file in download folder with default or randomly name as file name daliy changed and don't want to change the name of file
Sourepath correctly worked but Destinationpath not working
Sourepath = A1
Destinationpath =B2
oSimpleFileAccess.copy(Sourcepath, Destinationpath)
Sourepath correctly worked but Destinationpath not working
Sourepath = A1
Destinationpath =B2
oSimpleFileAccess.copy(Sourcepath, Destinationpath)
OpenOffice 4.0 on Windows 10
Re: [Solved] Execute .vbs file using macro in Calc
Please upload your ODF type sample file here. Then we will able to examine the URL/Path syntax. (What string is located in the cells?)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.