Posts by hilary4477

    I had tried that method, but it doesn't work. I had been using the developer tools to look at the response, but the javascript for the form is so complex and foreign to me that I'm having a hard time with it. The submit button returns a function, and my code doesn't seem to like that.


    Code
    strAuthenticate = "username=" & Username & "&password=" & Password & "&appid=4768" & "&submit=return validateAndSubmit(4768);"



    function validateAndSubmit(t){var i=$.trim($("#form_"+t+" input[name=username]").val()),a=$.trim($("#form_"+t+" input[name=password]").val());return""==i?(alert("Please type your "+$("#form_"+t+" input[name=username]").attr("label")),!1):""==a?(alert("Please type your "+$("#form_"+t+" input[name=password]").attr("label")),!1):void(validateCdsUser(i)&&$("#form_"+t).submit())}var hidshowappid=getHidQueryParamValue("hid.show");HigID.prototype={constructor:HigID,render:function(){var t=this._appId,i=this._buttonImage,a=this._appName;this.buttonData=new Object,this.buttonDataPut=function(t,i){""!=i&&(this.buttonData[t]=i)},this.buttonDataPut("buttonImage",this._buttonImage),this._button?$.ajax({url:hidserver+"/services/rest/apps/"+t+"/login_button",type:"GET",data:this.buttonData,dataType:"jsonp",jsonp:"callback",crossDomain:!0,success:function(e,n,o){if("true"==e[0].success)$("#hid_"+t).css("cursor","pointer").html(e[0].html);else if("0"==e[0].appalive)if(""!=i){var s='<img style="width:188px;height:75px;padding:0;" src="'+i+'" class="img-responsive hid-loginBtn" alt="'+a+'" data-target="#hid_systemDownModal" data-toggle="modal"/>';$("#hid_"+t).css("cursor","pointer").html(s)}

    No, it has always been a POST request. Bottom of page 1 has my working code.


    Code
    WHTTP.Open "POST", mainURL, False    
    WHTTP.setRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"    
    WHTTP.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36"    
    WHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"    
    WHTTP.send strAuthenticate


    It is still a POST request, but I don't know how to call the the username and password. I believe it's just the ID? And then submit the authentication code.

    Hi all,


    The code I had posted previously worked perfectly for a few years, until recently when the host page was just updated a couple weeks ago. Now I believe my authentication line doesn't work anymore. I've tried everything I can think of, but nothing gets me logged in. It's been a few years, so I can't recall where I got the line and how it was used, and sadly, I didn't explicitly say what I used in my comments in the code.


    My question:


    Code
    strAuthenticate = "username=" & Username & "&password=" & Password & "&countryLocation=US" & "&submit=+working...+" & "&jsUTCOffset=420"     '&jsUTCOffset=420 sets the time zone for my location.


    This is my old working code. Are the "username" and "password" ID tags? Or how do they get called in the html? I've tried the same username and password, and it doesn't work. I'd like to mention that the host page now has a log-in pop-up form.


    Code
    strAuthenticate = "username=" & Username & "&password=" & Password & "&onclick=return validateAndSubmit(4768);"


    This is my latest version, but I don't think I'm calling the form, or calling the submit button correctly. Here is the html for the submit button:


    HTML
    <button class="btn btn-primary hid-loginPanel-btn2" type="submit" id="hidSignIn" onclick="return validateAndSubmit(4768);"><span class="hid-social-text"><span>Sign In</span></span></button>



    Can anyone advise please?


    Thank you,


    Hilary

    Re: Make Selection from Website Popup Window


    Hi John,


    Thank you for your reply. I just got back to trying your code, and while I couldn't get it to work, I've decided to download the entire file without filtering it, (which I'll do later in Excel).


    I've gotten to the point where the bar comes up at the bottom of the popup window asking if I want to open, save, or cancel. I've tried many suggestions I've found on google, but nothing seems to work. My most recent trial was using modMain and modWindowsAPI, which I've updated for my 64-bit system, but my code gets stuck on the following code telling me the function is not defined. Although I see it on my modWindowsAPI module.


    Code
    hWnd = FindWindow("#32770", "Save As")


    I wish I could use WinHTTP or some other method to save the file, but the "Download" button URL changes every time the popup window loads, so that seems to be out the window. Is there another way to select "Save As"? I'm using IE11 now, but I'm afraid there will be other users of this code who will on 32-bit systems and using older versions of IE.


    Thank you,
    Hilary

    Re: Make Selection from Website Popup Window


    Hi John,


    This code works to click on the first "ETS" selection, but I can't seem to find the right code to get it to wait for the next window to load to make the next selection. It rolls right through the code before the choices are available.


    On a website, I click on tab that pulls up a popup window. From there I can make a selection which then pulls up more options on the same popup window. My code works to open the popup window, but how can I select an option from it to make my further selections?


    Here's what I have tried:


    Popup window code for the first option:


    Any help is greatly appreciated!


    Thanks,
    Hilary

    Re: IF/OR Statement


    I have been using almost the exact same code for other tabs that only have one "ws.name Like", and it works perfectly for all those. So I'm almost certain that the issue is with the IF/OR/AND part of my code.

    Re: IF/OR Statement


    I am trying to format several sheets with this code attached to a button, but when I click the button, the code only works on THAT page, and not the rest. How can I get it to work on several visible sheets all at once?



    Thanks in advance!
    Hilary

    Hey guys,


    I have a code that unhides a sheet ("Custom") when a user enters a number in a range on the "Cover Page" tab. From there, it determines in which cell the number is entered and changes the header row (Row 2) on the Custom tab accordingly. It also enters the count down in Col C. For example, if 3 was entered in the range, then Cells(4,3)="1", Cells(5,3)="2", Cells(6,3)="3". (I have another header in Row 3.) This all works great!
    My issue stems from when multiple numbers are entered in the range. I would like to have a new header row entered two rows below previous data and the Count from the next number in the range. Can someone please guide me in the right direction of what I need to do? My google searches have returned nothing useful for me. Thanks in advance!



    Re: Copy Duplicates and Adjacent Cell to different spreadsheet


    Thank you so much for your responses!


    Batman, I've looked over yours multiple times, but I can't figure out what's wrong. I think it might have to do with the nested With statements.
    Jindon, Yours copies over data, but it's not all right. It's missing quite a few models.


    I got this code to work, but then I tried to add on to the IF statement and it says there is a type mismatch. I'm hoping this may be the easiest fix?

    Re: Copy Duplicates and Adjacent Cell to different spreadsheet


    I've updated the code to fit my spreadhsheet, but I come across an error (Run-time error '1004: AutoFilter method of Range class failed). It comes back to the AutoFilter line, but I don't know what's wrong. I commented out the screen updating, and I don't see the "DUP" entered into ANY of the cells. Don't know if that's the cause of the problem.


    Also, the model number will never be the same for different manufacturers. So copying based on the model number works perfectly. One other thing to note: I noticed on your spreadsheet you had a quantity column. I don't have that. I'd need to count the number of times the model number is listed.


    Hi all,


    Ok, I have a spreadsheet ("Master List") with Column E and F having the manufacturer and model number of instrumentation, respectively. There can be anywhere from 2 of one model to 40, and my spreadsheet is over 8000 rows long.
    I want to search the model number (Column F) for duplicates, and then copy the manufacturer and model number to a different spreadsheet ("Reference"), Columns A and B, starting on Row 4. I would only want to copy them once though. On my reference sheet, I have another Column C for quantity of each, although I think I can just use the CountIf function for that.


    I've searched through other forums, and this is the code I've tried using, without success.



    Can someone please guide me? Thank you!

    Re: Call UserForm to Re-enter Password when Error logging in


    After a lot of research and trial and error, I finally got my code to work!