Posts by Eggcel

    Re: Simple VBA loop help


    try this

    Re: Simple VBA loop help


    Can you provide a sheet of sample data and a sheet with the expected result? Also, if you post the code that you have tried, someone could offer you pointers on how to amend it.

    Re: How to fetch the table from ASP web site and save in Excel


    Try something like this.


    This is untested but should do what you want based on your description.

    Re: List spicific worksheets and rename based on adjacent cell


    It's not as simple. That loop is just checking the user input names against each worksheet name then it is looping to create the sheets. Try this instead:


    If there is a duplicate entry by the user or if a sheetname already exists it will be skipped with no prompt to the user.

    Re: Automatically enter log on information on a webpage via VBA


    Use something like this

    Re: List spicific worksheets and rename based on adjacent cell


    Re: Send array argument to javascript function via Excel VBA


    You can set up a simple loop to see if you are dealing with frames

    Code
    Dim myHTMLDoc As HTMLDocument
    Dim myHTMLFrame As HTMLDocument
    'get the main HTML Document
     Set myHTMLDoc = IE.Document
     ' loop through frames
    For i = 1 To myHTMLDoc.frames
    Set myHTMLFrame = myHTMLDoc.frames(i).Document
    Next


    You have to set a reference to microsoft html object library. From what I have read, using frames is not as common anymore. If there is nothing to loop through, you will know you don't have multiple frames. The function has to be called from the parentwindow of the appropriate frame. If you do have frames, you could pull the innerhtml from each one and scan it for clues.

    Re: List spicific worksheets and rename based on adjacent cell


    See if this does what you want.


    Re: Send array argument to javascript function via Excel VBA


    Does the page employ frames at all? If so, some of the code could be in another frame. Also, do you have to navigate through a couple of pages to get to this point? If that is the case then there may be more info on a prior page. Have you tried different variations in your function call listing the items individually separated by commas, or tried one at a time?

    Re: Send array argument to javascript function via Excel VBA


    I wish I could be more help. If I could pick through the source code I might be able to figure something out. I have automated several web pages, but some of it is trial and error with bits of the source code. If you can manually select something on the page, then there is somewhere in the source code that references that. As for hidden tags, they are visible in the source code, they are just named hidden. I have run into drop down lists that use them, and multiple items are written to them as an array separated by commas. Let us know how you are getting on. Feel free to ask further questions and I will try to answer.


    Edit: I just saw your latest revision to your post. Something you might try is to manually make your selection and then write the value of levelldxarray to a string and then you might be able to see how the value is supposed to be listed when you call the function. Is LevelIdxarray listed elsewhere in the source code?

    Re: List spicific worksheets and rename based on adjacent cell


    Go with


    I also changed it so it will ignore blank cells in B.

    Re: List spicific worksheets and rename based on adjacent cell


    Try this.

    Re: Macro returning formula instead of value


    Quote

    but unfortunately I can only get it to return a formula and not a blank cell with the formula in the background.


    Can you explain this a bit more please. When I tested your first bit of code, it put the formula in the required cells.

    Re: Send array argument to javascript function via Excel VBA


    Is there somewhere else in your innerhtml source code that references the function you are trying to call? There may be an onclick event that fires the function.
    This may be key to your array values. I would guess that those are hidden tags that get their values by some input on the web page. It has been my limited experience that when automating web pages with a drop down list with multiple values, these values are written to the hidden tags for use when the function fires. Let me know if this gets you any further and I will try to help you more.

    Re: Capture values from active IE page


    Try this


    This will set the IE object to the open IE window. This will only work if it is the only IE window and tab open.