neilholmes
New Member
- Joined
- Feb 17, 2011
- Messages
- 13
Morning all,
I am hoping that someone will be able to help me with this complicated code I am trying to complete.
History:
I have created a workbook that goes to a website extracts data and sorts this for my clients. The content of the document pulls in financial information regarding investment funds and shows the user the best available fund matching a set of specific criteria.
I have now been asked to look into the posibility of the following.
One of the columns that is pulled into the spreadsheet is a 'reference' that identifies the fund. If the user takes this code and pastes it back into a search field on the original website, the fund will then be added to a list for further analysis.
What I would like to achieve:
I would ideally like a macro that,
1 - When the user 'double clicks' on the cell that contains the reference, the reference number is copied to clipboard. (These are listed in Column R)
2 - Once copied, the url for the website is opened, and the user is automatically logged in based on their user id.
3 - The code is then pasted into the correct field on the site and the fund for the code is then added to the pick list. *
* on the site I believe the search field is called "_FundSearch" this being the area the reference need to be pasted into. There is then a button that searches for the result, which I believe is: <ahref="javascript:void(0);" *******="goFundSearch(ge('_FundSearch'));" title="fund search">
<FONT color=#0000ff>Once the search is complete I believe the following adds the selected to the list: ;<a href="javascript:addInstrumentClient('F', ge('ListFund')); void(0);">add</a>
(I can play around with these fields to get the correct one)
Obviously this is complicated and I am unable to show you the login information for the site due to security. However I do have the following code (that works) to open the url and log the user into the account:
I therefore need help completing the copy/paste element of the code.
Additionally. It would also be extremely helpful if the code could identify if the login process has already been complete. So, for example if the user double clicks on a second 'reference number' the vb code does not try log them in a second time.
I understand that this is complex and may not be possible via vb, but any help anyone could offer would be greatly appreciated.... Or if anyone is looking for a challenge !
- Neil
I am hoping that someone will be able to help me with this complicated code I am trying to complete.
History:
I have created a workbook that goes to a website extracts data and sorts this for my clients. The content of the document pulls in financial information regarding investment funds and shows the user the best available fund matching a set of specific criteria.
I have now been asked to look into the posibility of the following.
One of the columns that is pulled into the spreadsheet is a 'reference' that identifies the fund. If the user takes this code and pastes it back into a search field on the original website, the fund will then be added to a list for further analysis.
What I would like to achieve:
I would ideally like a macro that,
1 - When the user 'double clicks' on the cell that contains the reference, the reference number is copied to clipboard. (These are listed in Column R)
2 - Once copied, the url for the website is opened, and the user is automatically logged in based on their user id.
3 - The code is then pasted into the correct field on the site and the fund for the code is then added to the pick list. *
* on the site I believe the search field is called "_FundSearch" this being the area the reference need to be pasted into. There is then a button that searches for the result, which I believe is: <ahref="javascript:void(0);" *******="goFundSearch(ge('_FundSearch'));" title="fund search">
<FONT color=#0000ff>Once the search is complete I believe the following adds the selected to the list: ;<a href="javascript:addInstrumentClient('F', ge('ListFund')); void(0);">add</a>
(I can play around with these fields to get the correct one)
Obviously this is complicated and I am unable to show you the login information for the site due to security. However I do have the following code (that works) to open the url and log the user into the account:
Code:
Sub AUTO_Login()
Application.ScreenUpdating = False
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.navigate ([URL]http://www.example.com[/URL])
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.all("txtGroup").Value = "groupname"
.document.all("txtUser").Value = "username"
.document.all("txtPassword").Value = "userpassword"
.document.all("btnAction").Click
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Debug.Print .LocationURL
End With
Application.ScreenUpdating = True
End Sub
I therefore need help completing the copy/paste element of the code.
Additionally. It would also be extremely helpful if the code could identify if the login process has already been complete. So, for example if the user double clicks on a second 'reference number' the vb code does not try log them in a second time.
I understand that this is complex and may not be possible via vb, but any help anyone could offer would be greatly appreciated.... Or if anyone is looking for a challenge !
- Neil