none
btnInput parameters to pass on filename value to a webpage RRS feed

  • Question

  • Dear All,

    We are working on an internal project wherein the parameters for a filename is to be passed from Excel to IE for file upload purpose. We've almost worked out the rest of the code for automating the process but currently stuck with the exact parameter which can be utilised alongwith btnInput for uploading the filename including exact path.

    The internal site is designed as a simple upload webpage, which has <input type='file'> tag and we are identifying the same within Excel VBA codes by utilising HTML libraries. We've tried a number of options to get the filename and path to be visible on the textbox within the IE page which would later on passed for upload purpose.

    Any help in this regard would be great.

    Rgds,

    Kapil

    Thursday, March 5, 2015 7:57 AM

Answers

  • Hi Kapil,

    Thanks for the detail expliantation for this issue.

    If I understood correctly, you were open a web page using VBA and want to pass the some parameter into the control on the web page.

    If so, I think there are two ways to achieve the goal. The first way you may modify the web page and add some script to initialize the value of control on the web page based on the query string in URL. And when we need to pass the parameter we can append it in the query string.

    The second way is using IE automation, we can get the document of web page via the IE object and set the element’s value.

    If you have issues about HTML developing and IE automation, I suggest that you reopen a new thread in Internet Explorer Web Development forum.

    And if you have issues about VBA syntax, I suggest that you get more effective response from VBA forum.

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 11, 2015 8:58 AM
    Moderator

All replies

  • Hi Kapil,

    This is the forum to discuss questions and feedback for Microsoft Excel (not support develop issue), your issue is related to development. I can't confirm it is belong to IE DEV or Excel DEV, thus, I move this thread to Where is the forum for forum. They will help you move the thread to target forum.

    https://social.technet.microsoft.com/Forums/en-US/home?forum=whatforum&filter=alltypes&sort=lastpostdesc

    Regards,


    George Zhao
    Forum Support
    ________________________________________
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "tnfsl@microsoft.com"


    Friday, March 6, 2015 5:09 AM
  • Hi Kapil_Innov8,

    >>We are working on an internal project wherein the parameters for a filename is to be passed from Excel to IE for file upload purpose. <<

    Would you mind sharing more detail about the secnario you were handling? What's the btninput you refered to?

    Based on my understanding, we can get the data from Excel application using Excel object model. However if you want to pass the data to a web page, it depends on the method you are developing. Would you mind sharing more detai about it to help us to understand this issue?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 10, 2015 2:02 AM
    Moderator
  • Dear Fei,

    We are calling the IE page within Excel and able to perform various functions. btnInput stands for button input which is based upon object model.

    While searching over internet, we found a number of examples where the same terminology had been used and hence we preferred to use the same.

    The case in point is being able to pass in filename into the textbox associated with browse button. Do let me know if you require more information.

    Regards,

    Kapil


    Rgds, Kapil

    Tuesday, March 10, 2015 5:39 AM
  • Hi Kapil,

    >>btnInput stands for button input which is based upon object model.<<

    Did you mean that the button in Excel or the button on the web page?

    >>The case in point is being able to pass in filename into the textbox associated with browse button<<

    Would you mind sharing a figure you were handling for this case or a demo to help us understand this issue exactly?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 10, 2015 9:19 AM
    Moderator
  • Hi Fei,

    As per the requirements, our solution is creating a run-time file on the user machine which needs to be sent to the application server. We do not have an FTP option and hence exploring the possibilities through a web page. This activity is to be undertaken by application as a back-end activity with user only being able to check the request status.

    The codes for webpage is as below:

    <!DOCTYPE>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    
    <form enctype="multipart/form-data" action="upload.php" method="POST">
    
    <input type="hidden" name="MAX_FILE_SIZE" value="5120000" />
    
    <input type="file" name="userfile" id="userfile"  />
    
    <input type="submit" name="submitHandler" value="Upload" />
    
    </form>
    
    </body>
    
    </html>

    We are able to successfully create a IE session, pass URL and open the webpage in VBA. However, we're currently stuck with VBA code for passing in the filename and location parameter within the text box alongwith browse.

    Our rest of the codes are ready but the entire development is currently stuck due to this single issue. Hopefully, someone within the community might be able to help.

    Regards,

    Kapil


    Rgds, Kapil

    Tuesday, March 10, 2015 10:10 AM
  • Hi Kapil,

    Thanks for the detail expliantation for this issue.

    If I understood correctly, you were open a web page using VBA and want to pass the some parameter into the control on the web page.

    If so, I think there are two ways to achieve the goal. The first way you may modify the web page and add some script to initialize the value of control on the web page based on the query string in URL. And when we need to pass the parameter we can append it in the query string.

    The second way is using IE automation, we can get the document of web page via the IE object and set the element’s value.

    If you have issues about HTML developing and IE automation, I suggest that you reopen a new thread in Internet Explorer Web Development forum.

    And if you have issues about VBA syntax, I suggest that you get more effective response from VBA forum.

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 11, 2015 8:58 AM
    Moderator
  • Hi Fei,

    Thanks for the update. The query is regarding IE automation. I'll open a thread within the appropriate forum.

    Regards,

    Kapil


    Rgds, Kapil

    Wednesday, March 11, 2015 9:03 AM