Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It stops on the second iteration of a loop at a point that it successfully
gets through when there is only a single iteration. I'm grabbing the visible text of a webpage using SendKeys to manipulate the menus in IE. Using CTRL+A, CTRL+C, and then coming back to Excel and doing CTRL+V doesn't work at all -- using CTRL in a SendKeys statement has never worked for me. But using the percent symbol for ALT does work: (with IE as the active app) SendKeys "{TAB 4}", True SendKeys "%e", True SendKeys "{DOWN 3}", True SendKeys "{ENTER}", True Wait (0.2) SendKeys "%e", True SendKeys "{DOWN 1}", True SendKeys "{ENTER}", True Wait (0.2) AppActivate "Microsoft Excel" Cells(CurURLReadRow, 10).Select SendKeys "{F2}", True ActiveSheet.Paste SendKeys "{ENTER}", True ---------- Since I'm using several SendKeys statements, I can't freely run the code to the point where it stops with the VB Editor open, because it "sends the keys" to the VB Editor. When there's a second URL to process, the code stops after executing: SendKeys "{F2}", True It's as if there is nothing in the clipboard to paste, AND as if there's no other code after that either. But in the IE window, the page contents are selected, just as in the case where there's only a single iteration. I'm open to a better way to do a lot of this. Manipulating the IE document object seems to be haphazard at best. It works for grabbing the Title and Description tags, but then it tells me that the number of IMGs and H2s is zero, when I'm looking right at them in the source. So I'm using it for the tags that it seems to handle properly, but the more examples I test with, the more I'm finding that the code isn't working as well as I thought it was. The most frustrating part is that I have found a workaround -- using SendKeys -- and it works, but only for one iteration. Using Excel 2000 on an XPSP2 machine. TIA... Gregg Roberts |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB Code stops working | Excel Programming | |||
Code Stops Prematurely | Excel Programming | |||
Code stops at range | Excel Programming | |||
(trying again...) code stops executing | Excel Programming | |||
VBA code stops executing | Excel Programming |