Hi everybody!
I have a question regarding VBA. I wanted to know, how I can learn to control internet explore using VBA from excel.
I would really appreciate if you give me a direction from where to start.
Thanks.
Hi everybody!
I have a question regarding VBA. I wanted to know, how I can learn to control internet explore using VBA from excel.
I would really appreciate if you give me a direction from where to start.
Thanks.
Hi Verbamore,
Here is a good place to start. http://www.codeforexcelandoutlook.co...rnet-explorer/
One of the problems is that most web sites use JavaScript which makes things a lot more difficult for us mere mortals.
Lewis
Here is some very simple code to get you started. I suggest you run it by single stepping through the debugger. The information output by 'DiagnosticDebugDotPrint()' contains information that you may be able to extract/paste from/to Internet Explorer. This only works in 32 bit Excel (apiShowWindow declaration must be updated to run in 64 bit Excel).
Substitute the URL of your choice, experiment, and looking at the Debugger locals window may help. 'Debug.Assert False' stops the debugger so you can examine items while everything is stopped. I only have very basic IE Automation skills, and everything I learned about IE automation has been very tedious and painful.
Lewis
Please Login or Register to view this content.
Hi LJMetzger
First of all I would like to say thank you for your huge help on this.
I just tried(was a long time since the last post, I was on vacation) and to be honest I didn’t understand to much. My knowledge on vba are very superficial.
So I was thinking to tell you some information for my project and maybe you have an idea to where to put my finite efforts.
What I’m trying to do is to create a UserForm. This should catch all my e-mails based on some conditions( I thinking to uses some filter). After that the code is gonna take the information from there and is gonna open IE. In IE the code is going to do some copy and paste( for this part was the purpose of the thread here).
My idea is to do all of this in backstage( not sure if this is possible) ,so I can do something else in meantime.
I know some stuff in vba I can’t say that I am a beginner nether an expert.
Based on above do you have any suggestion?
I am thinking perhaps vba is not the best solution to resolve this problem.
I would really appreciate if you could give me an idea about this.
I like the idea of filtering the e-mails. I don't think IE is a good tool to use. IE automation is very difficult and extremely time consuming to develop and debug the code. If you can import the data into Excel, Excel VBA is powerful enough to do almost anything with the data, and very efficient in terms of develop/debug time.This should catch all my e-mails based on some conditions( I thinking to uses some filter). After that the code is gonna take the information from there and is gonna open IE. In IE the code is going to do some copy and paste( for this part was the purpose of the thread here).
If you open up a separate instance of Excel, it can run and execute a macro while you do other things on the computer.My idea is to do all of this in backstage( not sure if this is possible) ,so I can do something else in meantime.
I hope this helps.
Lewis
Thank you Lewis.
I work using an online system. This system generate data based on what I request(using conditions).
For exp. let's assume that i have to add a name in one contract. what do I have to do is: run a report before I do changes, do changes( add the name) and run a report after changes. Everything is up to date and I don't know if there is any option to do this in excel.
Now that I see what you want to do, it's possible, but it will probably require a lot of programming skill. It is way beyond my capabilities.
Having said that, here is another more advanced working example code. This attempts to log in to a web site (and fails - I don't have an account on the web site). It enters log in information, and attempts to log in. The debugger output will show you data after various steps along the way. Once past the log in Screen, most web sites switch to Javascript. You have now tapped almost my entire Internet Automation knowledge.
Here are a few debugger tips.
a. Press 'F8' to single step (goes into subroutines and functions).
b. Press SHIFT 'F8' to single step OVER subroutines and functions.
c. Press CTRL 'F8' to stop at the line where the cursor is.
d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
output to the IMMEDIATE WINDOW.
f. Select View > Locals to see all variables while debugging.
g. To automatically set a BREAKPOINT at a certain location put in the line:
'Debug.Assert False'
h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
if i >= 20 and xTV20 > 99.56 then
Debug.Assert False
endif
i. A variable value will be displayed by putting the cursor over the variable name.
Lewis
Please Login or Register to view this content.
Thanks man for your help, but I can't understand I have just some basic knowledge in vba.
I have already resolve the problem of doing log in and open two different tabs,[I used clng(2028)] ( this because as i explained above, i need to run reports, so one tab is for the contract that i have to changes and the other is the tab that I opened for the report section. Before doing changes i have to run a report. What i do is press f12 and find the element( in my case is contract name) by clicking. After i have found the contract name, I have to copy and paste to the other tab( the tab that i use to run report) no clue how to do this. So copy element text form one tab to another.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks