Do While Ie.busy Or Ie.readystate <> Readystate_complete --- Not Working !!! |
Do While Ie.busy Or Ie.readystate <> Readystate_complete --- Not Working !!! - Excel |
|
Im using :
'wait until the page loads
Do While ie.Busy Or ie.readyState READYSTATE_COMPLETE
DoEvents
Loop
This doesnt seem to work well enough, since actions are occuring that should NOT occur until the browser is ready.
Any other ideas as to how to make IE wait until the page is completely ready? I wondered about possibly checking the .innerHTML to verify that a unique page element is present.
Thanks,
Scott
Similar Topics
So far I can get everything to work besides the Submit part. The code runs without errors, but doesn't actually "hit" the submit button on the webpage.
For posting, I removed my actual user name and password and and used the generic " User Name " and " Password " highlighted in blue.
I highlighted another section in green that I took from a previous post hoping it would solve my problem. The link is: http://www.mrexcel.com/forum/showthr...xplorer+submit
Here is the code I am using:
Sub GoToWebSiteAndPlayAroundNew()
Dim appIE As Object ' InternetExplorer.Application
Dim URL As String
Set appIE = CreateObject("InternetExplorer.Application")
URL = " https://efolio.morgankeegan.com/escripts/defaultLogon.asp?errCode=2 "
With appIE
.navigate URL
.Visible = True
Do While .busy: DoEvents: Loop
Do While .ReadyState 4: DoEvents: Loop
.document.getelementbyid("fUserName").Value = " UserName "
.document.getelementbyid("fPassword").Value = " Password "
End With
On Error Resume Next
x = 0
For Each mitem In IE.document.all
mitem.Value = "x"
x = x + 1
Next
x = 0
For Each mitem In IE.document.all
If x = "Submit" Then
mitem.Click
Exit For
End If
Next
End Sub
I have a piece of code called ConvertDates that formats data contained on 6 worksheets. The 6 data sheets all contain a data connection to a website of foreign exchange tables.
What I want is for my code to execute as soon as the data connection refresh has finished.
When I use the statement
Code:
ActiveWorkbook.RefreshAll Application.Run "Project1.xlsm!ConvertDates"
The code executes the macro whilst the refresh is still happening, thereby screwing up my results. I don't really want to use a timed wait, because the refresh speed is going to vary from user to user.
Is there some way I can tell excel to wait till the refresh has finished and then execute the code?
Any help would be hugely appreciated.
Here is my situation. I have been trying to learn macros but have not made one yet. Need your help. Here at work, I have some incompentant computer workers who claim they KNOW MS sooo well and have certificates etc... *COUGH COUGH* ya ok... LMAO
We have a "shared" work book we all work in. It's nothing fancy, just use it as a PO Book but since it is shared some people continue to not save before they add in more work so that they see a "refreshed" copy of the workbook before they start writing in cells that already contain information.
How to I create a macro button at the top of the page that is literally a SAVE button.. instead of them saving by going to File - Save or cntrl+s ??? I just thought that MAYBE having a big button in their face will remind them.
Secondly as back up I was wondering if you can create a macro to do a refresh of everyones screens automatically - say every 2 or 5 mins??? I don't mean a save... but a refresh so the screen actually updates in front of you. (although I will keep this little piece of magic out of their knowledge so they don't rely on it, just though it would be a secondary back up to helping eliminate these mishaps cause we are loosing alot of information by people saving overtop of other peoples work and not caring.)
Thanks so much!!!!! Muchly appriciated.
The cell turns blue and then wherever I move, it highlights those to.
No matter where I go on the page. If I Alt-Tab and work in another
program on my computer, that excel page keeps highlighting wherever
I move even in those other programs (I know this sounds confusing).
When I return to excel thousands and thousands of cells are blue.
The biggest problem is that the highlighting won't turn off, no matter
what. I can't select anything from the tool bars, do any work on the sheet or close the program.
I can close it only with the task manager but when I open it again,
the cursor is still stuck in the highlighting mode and won't perform any
other functions.
Do you think this is a problem with my computer, the excel program? I have changed my mouse and this didn't help.
Is there some shortcut to turn off this highlight feature other than restarting
my computer. Which is the only current way I can get rid of it.
Thanks for any advice,
The problem is I can use code such as
strHTMLText = ie.Document.body.innerText
or
strHTMLText = ie.Document.body.outerText
to retrieve the code, but in either case only part, not all, of the source code is captured. I need ALL the code. Is there some kind of code such as ie.Document.body.allText or similar that would perform this function?
Much obliged!
I would like to send SMS from a VBA macro to my mobile phone. Do anyone know how to do this?
I am ready to pay a cost per SMS if necessary.
(I asked the same question at another Excel forum without getting any reply.)
TIA
Firstly i haven't used excel to a great extent since my college days. So i'm having to re-learn 99.9% of everything i once new...
I am volunteering for a non profit organization and trying to create a reservation system for the rooms that they have - kind of like hotel software, but in excel (i did a similiar thing in college but for plane seats)
Please find it attached.
What i need it to do:
Copy all of the info from the main page to the guest lit (a new row each time).
From the guest list to the Gannt chart - i did a few tutorials on dynamic gantt charts using conditional formatting but cannot get them to work when based on data on a different worksheet.
Finaly is there a way to check for availabilty on any given date?
if just someone could point me in the right direction, i would be appreciate it so much words can't express!!!
Best Regards,
Jamie
P.S for the calender drop down on the main page, i'm using 'microsoft time & date picker 6.0)
http://www.2shared.com/file/6521961/...ibsV05b32.html - pop ups on this site
http://www.easy-share.com/1906519167/RibsV0.5b3.2.xlsm - same file, better website
to the email address, like change the font color or change on letter, Excel
tries to email the address. If I click in the formula bar to make the
changes, it automatically changes it back to all blue text and underlined. I
have tried to format all of the cells as "Text" to show as entered, but it
doesnt work. PLEASE HELP
Cheers,
Doug
Every so often when I attempt to save a file, (including save as), Excel won'r let me. By won't let me I mean:
using Save doesn't appear to do anything using Save As doesn't either do anything, the dialog is not displayed and if I am doing via the File menu then the File menu is exited and the previous ribbon tab is displayed (i.ethe one I was on before clicking 'File') if I close the workbook I am prompted to save, close without saving or cancel. Clicking save just invokes the same msgbox again. I can't work out when it goes into this mode. Some days I can work without this problem, other days I encounter this 2 or 3 times.
The only thing I could suspect was I think this started around about the time I installed xlDennis' code library. I have uninstalled the addin and so far so good, but I cannot categorically say that this was the cause.
Anyone have any idea?
Cheers
Jon
Edit: I have read this: http://support.microsoft.com/kb/271513
Doesn't seem to cover the issue I describe
My problem was that a userform defined with Excel at work (containing DT pickers) gave the message in the title when opening it at home. I had a light-bulb moment and wondered whether there was a difference in the version numbers for MSCOMCT2.OCX at work and at home. Turned out the work version was newer. I then copied the MSCOMCT2.* files from work, made a backup of them at home and copied those from work to my C-drive (Windows XP - c:\windows\system32\ ).
No luck. I then rebooted the machine - still no luck.
Then, finally I unregistered the old DLL via
Code:
regsvr32 /u c:\windows\system32\MSCOMCT2.OCX
(not sure if this was necessary, but I didn't think it could hurt). Reregistered the DLL via
Code:
regsvr32 c:\windows\system32\MSCOMCT2.OCX
and what do you know - it worked.
Summa summarum - it could be an idea to check whether the two machines have different version numbers for the MSCOMCT2.OCX files.
I am working on a worksheet, and would like to have an entire row transferred to another worksheet based upon a certain cell's value.
Having searched through the many solved threads on this site, I attempted to customize some of the code to my worksheet. Not being proficient in Macro/VBA, I failed. I figured I would ask for help, and see if anyone can provide what I am looking for.
Basically, I am attempting to construct a "work in process" file, and would like all completed work to be deleted from the work in process sheet, and transferred to a sheet that contains a running list of all work completed.
Attached is an example of what I am working on. I would like Column Q (Status) to determine if a row can be moved to a sheet that contains the list of all work completed, and eliminated from the original sheet. Once Status is updated to "Complete", it would be helpful to be able to run a macro/click a button that would perform the transfer.
Can anyone assist?
Thanks!
Hoping someone can help me quickly as I'm pulling my hair out and have a deadline getting too close.
Been trailing the net and this board but can't work out how to do a simple variance.
How do I work out the difference between two numbers - including negatives.
If the numbers are all positive, it's fine as it's simply a case of A - B = C which is your difference. However, that doesn't work if B is negative.
I need a formula that would give the following:
First Number / Second Number / Difference
1 / 5 / 4
1 / -5 / -6
-1 / 5 / 6
-1 / -5 / -4
-5 / -1 / 4
Hopefully there's a simple function I've been missing.
Thanks in advance, R
----------------------------------------------------------------------
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'this disables the save function on the XLS
MsgBox "****Save is Disabled****"
' Following line will prevent all saving
Cancel = True
' Following line will prevent the Save As Dialog box from showing
If SaveAsUI Then SaveAsUI = False
End Sub
What could be wrong?
Im unable to put any pics up as my work pc has java disable so photobucket ect won't work but has anyone else come across this problem and how did you rectify it? A search macro perhaps?