Author: GuyHoozdis
Subject: Understanding Internet explorer instances
Posted: 04 July 2013 at 9:05am
AaronMar is correct, but I doubt he is really guessing. The code snippets you show indicate that your project is using COM/DCOM. If you are not familiar with these concepts you should read-up on the WebBrowser Control. I would skip reading too deep into DDE until you are familiar with the fundamentals. Unless you are suspending threads in or changing the process priority on processes you don't own, then knowing or not-knowing about DDE is unlikely to affect the outcome of your project.
From your second post it sounds like you are looking at an example project (not code that you wrote) in Visual Studio- researching for you own project that you are about to create I presume. Cool! May I point out a thing or two that will be helpful to your understanding, I think.
First, the string "InternetExplorer.Application" that is being used in your code is called a version independent ProgID. You will find that you can instantiate several other Windows applications, in particular all of the Office suite applications, using a very similar pattern.
For example,
Second, if you look in the Registry on your system under the HKEY_CLASSES_ROOT hive you will find the aforementioned ProgIDs and more!
For example,
Third, in the example project you are looking at, where you pulled the code snippets from, you should see a line that says
When you are creating your objects, but aren't "seeing them"... just remember this. The object will not be visible until you explicitly make it so.
Finally, to answer your question about other ways to run VB code. Most, if not all, of the Office applications should provide an editor where you can write and execute VB code.
Subject: Understanding Internet explorer instances
Posted: 04 July 2013 at 9:05am
AaronMar is correct, but I doubt he is really guessing. The code snippets you show indicate that your project is using COM/DCOM. If you are not familiar with these concepts you should read-up on the WebBrowser Control. I would skip reading too deep into DDE until you are familiar with the fundamentals. Unless you are suspending threads in or changing the process priority on processes you don't own, then knowing or not-knowing about DDE is unlikely to affect the outcome of your project.
From your second post it sounds like you are looking at an example project (not code that you wrote) in Visual Studio- researching for you own project that you are about to create I presume. Cool! May I point out a thing or two that will be helpful to your understanding, I think.
First, the string "InternetExplorer.Application" that is being used in your code is called a version independent ProgID. You will find that you can instantiate several other Windows applications, in particular all of the Office suite applications, using a very similar pattern.
For example,
- Excel.Application
- Outlook.Application
- Word.Application
- ...
Second, if you look in the Registry on your system under the HKEY_CLASSES_ROOT hive you will find the aforementioned ProgIDs and more!
For example,
- HKEY_CLASSES_ROOT\Excel.Application
- HKEY_CLASSES_ROOT\InternetExplorer.Application
- HKEY_CLASSES_ROOT\Office.Application
- ...
Third, in the example project you are looking at, where you pulled the code snippets from, you should see a line that says
ie.Visible = True |
When you are creating your objects, but aren't "seeing them"... just remember this. The object will not be visible until you explicitly make it so.
Finally, to answer your question about other ways to run VB code. Most, if not all, of the Office applications should provide an editor where you can write and execute VB code.
- Open a new workbook in Excel
- Select the "Developer" tab
- Select the "Visual Basic" option
Note: If you don't see the "Developer" tab then you will need to take some steps to enable it- refer to Google... or Bing (sorry, Bill)... whatever your preference.
The image you see here shows code from some of the provided Add-Ins. You won't have them unless you enable them manually, but you should have the "VBAProject (book1)", where you can write your own VB modules.
Best of luck!