How to Use the Shell Automation Library in VBA | Part 1

  Рет қаралды 16,929

Sigma Coding

Sigma Coding

Күн бұрын

The Microsoft Shells Control library makes working with system operations a breeze. With this library, we can execute a wide variety of scripts, grab system settings and information, and grab system folders. In this tutorial, we will explore some of the fundamentals of using the Shell library and how to interact with different system settings.
Video Resources:
--------------------------------------------------
Resource: GitHub File
Link: github.com/are...
Resource: Microsoft Shell Folder Constants
Link: docs.microsoft...
Resource: Microsoft Shell Object
Link: docs.microsoft...
Resource: Microsoft Shell Settings
Link: docs.microsoft...
Resource: Microsoft System Info
Link: docs.microsoft...
Resources:
--------------------------------------------------
Facebook Page: / codingsigma
Facebook Group: / sigmacoding
GitHub Sigma Coding: github.com/are...
Support Sigma Coding:
--------------------------------------------------
Patreon: / sigmacoding
Amazon Associates: amzn.to/3bsTI5P **
Related Topics:
--------------------------------------------------
Title: How To Programmatically Add Library References Using VBA
Link: • How To Programmaticall...
Title: How to Work With the Command Bar Object in VBA
Link: • How to Work With the C...
Title: How to Work With the Command Bar Control Object in VBA
Link: • How to Work With the C...
Title: How to Export Macros Using VBA
Link: • How to Export Macros U...
Title: How To Run A Python Script Using Excel VBA
Link: • How To Run A Python Sc...
Title: How to Use the Shell Automation Library in VBA | Part 1
Link: • How to Use the Shell A...
Title: How To Control The Visual Basic Editor With VBA
Link: • How To Control The Vis...
Title: Web Scraping With VBA | Part One
Link: • Web Scraping With VBA ...
Title: Web Scraping With VBA | Part Three
Link: • Web Scraping With VBA ...
Title: Web Scraping With VBA | Part Two
Link: • Web Scraping With VBA ...
Title: Web Scraping With VBA | Scraping Data Tables
Link: • Web Scraping With VBA ...
Title: Making API Requests in VBA | JSON
Link: • Making API Requests in...
Title: Making API Requests in VBA | XML
Link: • Making API Requests in...
Title: How To Pull Data From Access Using VBA
Link: • How To Pull Data From ...
Title: Importing Text Files In VBA
Link: • Importing Text Files I...
Title: How to Use the File System Object in VBA
Link: • How to Use the File Sy...
Title: How to Build Windows Forms Applications in Python | Pt. 2
Link: • How to Schedule a Macr...
**Amazon Associates Disclosure:
--------------------------------------------------
I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. One of the ways I support the channel is by using Amazon Associates to earn fees on purchases you make. That means when you use the link above, it will track any purchases made from that link and give a small portion of it to the Sigma Coding. I love this approach because it allows you to do what you're already doing (shopping) but also helps support the channels you care about. Also, it makes it where I can invest that revenue to help improve and grow the channel.
Tags:
--------------------------------------------------
#Excel #VBA #ShellObject

Пікірлер: 27
@danielkrajnik3817
@danielkrajnik3817 4 жыл бұрын
wow, this actually looks really useful
@SigmaCoding
@SigmaCoding 4 жыл бұрын
:)
@ganeshs1360
@ganeshs1360 Жыл бұрын
i have a scenario where i need to write file properties like Tags and Comments to any file type. Is there a way i can do this using Shell32?
@marcelitosweb
@marcelitosweb 5 жыл бұрын
Does the ShellExecute method wait until the called script has ended executing to move on with the program? I've been using the default vba shell command and that's an annoying issue I have. Obviously I can put an application.wait after it, but that's just a workaround. Thanks.
@SigmaCoding
@SigmaCoding 5 жыл бұрын
Unfortunately, it is asynchronous and it will not wait until the script is finishing running before moving on to the next line. The work around is what you mentioned above, making Excel "sleep" for a specified time.
@SigmaCoding
@SigmaCoding 5 жыл бұрын
I also found a post on Stack Overflow that might work for you, they use the `WScript.Shell` but with that object you can define the `WaitOnReturn` parameter that will make it synchronous. stackoverflow.com/questions/15951837/wait-for-shell-command-to-complete
@H-do8tr
@H-do8tr Жыл бұрын
GREAT! How Can I export the first four sheets of the workbook as PDF and export another word file in the same folder then export the rest of sheets. All these exported should be merged in one PDF in that order
@Matt-zp9jg
@Matt-zp9jg Жыл бұрын
Is part two coming soon?
@evanrudibaugh8772
@evanrudibaugh8772 4 жыл бұрын
Hey: how do you handle namespace with variable inputs? Set objFolder = shellObj.namespace("C:\ExampleFolder") will work fine for me, but if I have something like folderName = "C:\ExampleFolder" Set objFolder = shellObj.namespace(folderName) I end up with errors.
@firstcommenter202
@firstcommenter202 3 жыл бұрын
File System Objects can do the folders
@kabukijoe99
@kabukijoe99 2 жыл бұрын
good lesson
@KhalilYasser
@KhalilYasser 5 жыл бұрын
Thanks a lot. The link to Github seems to be broken. Can you provide with the code please?
@SigmaCoding
@SigmaCoding 5 жыл бұрын
Here is the link to the file: github.com/areed1192/sigma_coding_youtube/tree/master/vba/advanced-vba/scripting-automation-library FYI, I change the organization of the folders sometimes so I can't guarantee the link always works. Normally I just direct people to the main GitHub page and I organize it in such a way that usually it's easy to find. Some videos though I never posted the code, but those are very limited cases.
@lautarob
@lautarob 5 жыл бұрын
Thank you! Sorry, but the link is broke. Further, the content for the .py file is needed.
@SigmaCoding
@SigmaCoding 5 жыл бұрын
Here is the link: github.com/areed1192/sigma_coding_youtube/tree/master/vba/advanced-vba/scripting-automation-library Sadly I don't have the python file anymore but it's easy to create one for a test case.
@lautarob
@lautarob 5 жыл бұрын
@@SigmaCoding Thank you!
How to Schedule a Macro to Run at Certain Times
15:46
Sigma Coding
Рет қаралды 30 М.
Use Excel VBA to Read API Data
20:48
Excel Macro Mastery
Рет қаралды 143 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 7 МЛН
Windows API in VBA - First Steps
17:47
codekabinett.com/en
Рет қаралды 9 М.
Making API Requests in VBA | XML
32:06
Sigma Coding
Рет қаралды 18 М.
Switch Between Open Applications Using AppActivate in Microsoft Access VBA
17:45
How to Work With the Command Bar Object in VBA
19:01
Sigma Coding
Рет қаралды 10 М.
Making API Requests in VBA | JSON
26:17
Sigma Coding
Рет қаралды 44 М.
Wise Owl Answers - How do I unzip files using VBA?
13:25
WiseOwlTutorials
Рет қаралды 7 М.
How to use Custom Types To Write Ultra Fast VBA code
12:51
Excel Macro Mastery
Рет қаралды 33 М.
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
Leila Gharani
Рет қаралды 336 М.
How To Programmatically Add Library References Using VBA
16:41
Sigma Coding
Рет қаралды 16 М.