API To Retrieve A Webpage Needing Username And Password
Jan 30, 2008
I've been playing around with the API functions (specifically, InternetOpenURL) to retrieve the contents of an HTTP webpage and store the information within a text file, using Excel VBA. It works great for any "normal" webpage not requiring a "Username" and "Password" login. I can't find any examples on how this is done for a webpage requiring such a login? I've heard you can do this via sending the appropriate cookie to the server, but I can't find any documentation on the web? Does anyone have any idea on how this functionality is achieved?
View 9 Replies
ADVERTISEMENT
May 13, 2008
I am having a really difficult time with this code. I am trying to fill in some fields on an webpage in an effort to eventually retrieve some data. I have read lots of posts on the topic and somehow I'm still confused. My code crashes on this line and gives an Automation error, Unspecified Error message: With appIE.document.forms(0). No matter what I try, I can't get past this line. I have also tried: With appIE.document.all
Sub PropInfo()
Dim appIE As SHDocVw.InternetExplorer
Set appIE = CreateObject("INTERNETEXPLORER.APPLICATION")
appIE.Visible = True
appIE.navigate "http://gisims2.miamidade.gov/MyHome/proptext.asp"
Do While appIE.Busy: DoEvents: Loop
Do While appIE.readyState <> complete: DoEvents: Loop
With appIE.document.all
.Item("cmd").Value = "FINDADDR"
.Item("cmdTemp").Value = "FINDADDR"
.Item("searchtool").Value = "ADDR" 'Search by' dropdown
.Item("stnum").Value = "2417" 'house #' field
.Item("stdir").Value = ""
.Item("stname").Value = "ponce de leon" 'street name' field
.Item("sttype").Value = "BLVD" 'street type' field
.submit
End With
End Sub
View 2 Replies
View Related
May 31, 2013
I have below piece of code which I'm not sure how to finish up. What I'm trying to do is have 'Username' and 'password' entered before logging into the workbook. It does not have to be 'UserForm" if it is possible, but it would be useful if we use Ucase...
I'm just not sure how this code works with
"Sub sUserLogon(strStandardID As String, strPassword As String)"
stated in this way..
VB:
Sub sUserLogon(strStandardID As String, strPassword As String)
Dim strUserName As String
Dim StrMessage As String
Application.DisplayAlertsAlerts = False
StrMessage = "User Logged In"
[Code] ......
View 2 Replies
View Related
Feb 7, 2007
I am using the below code to access a website with IE.
My next step (of many) is to Login to this website.
The login screen requires that I enter:
User Name:
Password:
How can I tell IE to enter my user name and Password?
Sub Macro2()
'
'Macro2 Macro
' Macro recorded 2/6/2007 by dsggodwin
Public Sub Goto_ToyotaSupplier_Click()
Dim EXP
Set EXP = CreateObject("InternetExplorer.application")
EXP.Visible = True
'put the webpage here
EXP.Navigate ("https://www.portal.toyotasupplier.com/skpi/SkpiGatewayServlet?jadeAction=NCPARTS_SEARCH")
End Sub
View 9 Replies
View Related
Feb 18, 2010
I'm trying to create a program that will automatically log in to a website that requires a username & password. I am able to enter the username and password in the correct text boxes, but I can not get the form to submit to approve the login. It refreshes and removes the password.
I have attached my code. The web url is inside it.
Sub IE_login()
Dim ie As InternetExplorer
Dim C
Dim ULogin As Boolean, ieForm
Dim MyPass As String, MyLogin As String
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "https://applications.dacgroup.com/login.aspx"
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
View 9 Replies
View Related
Jan 9, 2007
code below, I need :
1) navigate to a web page
2) submit my userId and password
3) beeing redirected to a different url I have to menage this situation for passing url to
4) quering sub
I am using Excel 2000 with win98
Error 429 Can't create object:which one?
Public Sub First()
Dim obEx As Object
Dim obj As New MSHTML.HTMLBody
Dim strPass As String
Dim elUid As New MSHTML.HTMLInputElement
Dim elPass As New MSHTML.HTMLInputElement
Dim elSubmit As New MSHTML.HTMLInputElement
Dim strUid As String
Dim Desc As String
View 9 Replies
View Related
Jul 22, 2014
As part of my requirement, i'm trying to update some data into share path. While trying to access the share path, i'm being asked to key-in appropriate username & password. Windows alert will be opened when my code try to access share path, there I have to enter username & password using script.
Is there any way achieve this using VBA?
View 2 Replies
View Related
Oct 25, 2007
I am trying to log on to an FTP site and post a file through Excel VB. I have managed to open a new Explorer window and direct it to the URL, but I don't know what to do next. After navigation to the URL a Pop-Up Window comes asking for UserName and Password and I don't know how to supply it and click submit.
After I have completed that I will need to give the path of the file, click post, and close the window when it is done.
Here is what I got so far:
The commented out stuff is not working. I got it off a similar application that someone else in my company wrote that accomplishes a similar task.
Sub SConnect()
Dim IE As InternetExplorer
Dim IEURL As String
Dim IEDoc As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")
Set IE = New InternetExplorer
IE.Visible = True
IEURL = "https://something.com" .................
View 4 Replies
View Related
Nov 21, 2007
I'd like to automatically enter the username and password from a spreadsheet.
Currently, I've got a spreadsheet that has a login id in one cell and a password in an adjacent cell.
I click a button on the spreadsheet to call a hyperlink to a webpage while excell is using the copy function to copy the username to the clipboard.
Once the webpage loads, I just paste the username into the username box.
Then I go back to excel, copy the password, then back to the webpage and pastes the password.
This works good for me, but I'd like to make it a little bit better.
What I'd like to be able to do, if I had the username and password in one cell seperated by a symbol (say, "=" since usually don't use that one) then when I hyperlink to the webpage, I hit paste.
>> this time, when I hit paste, (maybe using some kind of a api code or something), excel pastes into the first box, *automatically* hits the [TAB] key, and paste the password.
View 3 Replies
View Related
Jul 31, 2005
I am trying to import data from a website protected by ID and password. I do have the login ID and Password to login to the website.
I am importing data from the website to my excel sheet to track some shipping informations. I do have the 'Import to Excel' option but I would rather open the
spreadsheet and click Refresh Data and have all the Data imported with click of a button.
I have already tried to use Import External Data but it is not working.
View 9 Replies
View Related
Aug 20, 2008
I was able to get some help a while ago and hoping for someone to reply as well. Any one have ideas how to create a userform which will be use for username and password input? I know how to create one but is there anyway that the username and password will be stored as .txt file instead of using worksheet to store the data?
View 14 Replies
View Related
Jun 23, 2014
I trying to create a paperless petty cash system. I have my sheet all setup and calculating how I want. When a user makes an entry they Enter their name in column "W".
I am trying to overcome the problem of accountability. I need to achieve a cell calls for Username and Password and if correct the persons name is entered into cell then Row is locked to prevent figures being altered etc. But also if user made mistake they need to unlock it somehow someway
Sure this achievable from snippets of info I seen online but its way beyond my abilities. I realise a determined user can circumvent this if they wanted to.
View 5 Replies
View Related
Aug 8, 2014
I have a spreadsheet (don't we all) that is currently password protected - you double click the file and need to input a password before it will open.
I have some code that will protect a workbook from changes and only unlock for specific usernames, and i wonder if there is some code that will do the following:
-User opens spreadsheet
-VBA looks at the username trying to open the sheet, for this example the username is Paul.Smith
-Paul.Smith is not one of the people who should have regular access to this sheet - so the VBA requests a password from him prior to opening the sheet.
My username opens the same sheet (galvin.paddy), VBA see's that my name is one of the 'Authorised Users', removes the password and opens the sheet for me ready for use.
View 14 Replies
View Related
Jul 18, 2005
Trying to find a set of code that I can use to open a website that's predetermined, and enter in the users name and password automatically. And if possible, open a new email via the website, addressed to a person, and ready to browse for the file to attach.
The code I have is below.
Private Sub CommandButton1_Click()
'
storenumber = [$c$3]
If [$iv$2] = True Then
If [$iv$3] 0 Then
MsgBox ("Can't send with No Adjustments Checked & Items to Adjust, Please clear one")
End
End If
End If..................
View 9 Replies
View Related
Jan 3, 2011
I need a macro ie when a user opens a macro enabled workbook,he should be asked for a username and password to access workbook. Administrator should have right to create users with reset password rights
View 5 Replies
View Related
Jun 18, 2012
Using Excel2010 in Windows7. I have a UserForm
1: TextBox for Input Username (txtUsernameIn)
2: TextBox for Input Password (txtPasswordIn)
3) Submit Button (cmdSubmit1)
I have a Worksheet
ColA: Username
ColB: Password
And this entire Range A:B, I have named "UserRegister"
I have code, attached to the cmdSubmit1 button on my UserForm. The purpose is to allow access to a veryhidden Worksheet "ADMIN".
The code 'works' if I enter in both the correct UserName and Password (ie: the code completes & Admin sheet opens up).
The code 'works' if I enter in the correct UserName and the wrong password (ie: code completes it's run, my msg pops up to say there is wrong input, unloads the form & sheet ADMIN stays veryhidden).
However, if I enter the wrong username (with either right or wrong password) the code breaks and I get a debug error. I know my code is obviously wrong/missing something etc - but I can't work it out! The line of code highlighted on the break, is between the *** below
VB:
Private Sub cmdSubmit1_Click()
Dim Username As String
Username = txtUserNameIn.Text
Dim password As String
password = txtPasswordIn.Text
[Code] ......
View 9 Replies
View Related
Mar 23, 2014
I have Excel Sheet that open with user name and password.
Like if it's open my Admin - he can view all Sheets
If open by any user - it opens only users sheet.
Problem is once file is saved by any users, all hidden files get unhidden and Admin Sheet is open.
Requirement: if User1 saves file other sheets should not get unhidden.
View 1 Replies
View Related
May 14, 2014
I've named the password to my protected workbook using this code:
ActiveWorkbook.Names.Add Name:="password", RefersTo:=pWord1
I then want to be able to close down Excel, switch off the computer, open all back up again and retrieve the password. I've tried the code:
pWord1 = Evaluate(ActiveWorkbook.Names("password").RefersTo)
But I get this:
Run-time error '1004': Application-defined or object-defined error
How to retrieve the password from the named variable after closing?
This is to protect and unprotect the workbook whenever I open and close it to timestamp a spreadsheet in it. I don't want the daily user to be able to see the time stamped spreadsheet and so need to keep it hidden and the spreadsheet protected over the course of many days when I'm not round.
View 2 Replies
View Related
Oct 5, 2007
I have a thousand names on a column, and I have a several worksheet tabs as locations, such as CA, AZ, TX, and NY.
All names goes to main worksheet, show like this
apitchford 10 100 123
bkishpaugh 9 211 123
blee 14 234 111
cbonny 21 125 412
I need to pull a specific name, example, name = blee, move that name with all data on that row into TX.
I will need to set as automatically, becuase the names add and delete on the main worksheet, and will auto update those tab worksheets. (make sense?)
I have tried INDEX and MATCH, but they keep putting one data in, not all data.
View 9 Replies
View Related
Dec 4, 2008
i need to create an IF and an And formula for the debit columns and credit columns of an income statement and a balance sheet on a 10 column worksheet. The formula for each column will be slightly different but will be the same for every row in the respective column. the formulas must check to see if the account number is associated with an asset, liability, or owner's equity. this will determine if it is a credit or debit balance. my basic goal is to enter all values in unadjusted trial balance and adjustments, while all the other columns fill in automatically.
View 9 Replies
View Related
Sep 21, 2007
I am trying to use an IF Condition for multiple options and have forgotten how to make it work. Here is my basic formula:
=IF((B20="CHASE"),SUM(C20:I20))
I need to have several other options in B20 to "CHASE", like AMEX, DISC, BOA and CASH, so I need the B20 result to reflect which of those conditions exist in order to find the sum of C20:I20. I cannot seem to get any configuration to work.
View 9 Replies
View Related
May 9, 2008
i have a graph that i've linked to let's say cells A1:C150
however, my range could sometimes needs to be shrunken to A1:A100 or A1:A40 etc. (the number of rows that are "active" is determined by cell K27)
i'd like for my graph to automatically adjust depending on the number of rows that are filled within the range above. can this be done with formulas and graph manipulations?
i've put in a formula currently that makes the value of the cells that would return 0 into "" but that doesn't seem to do the trick.
View 9 Replies
View Related
May 14, 2009
I have a table with subtotals that I need to find the largest value for the subtotal results and then return the cell contents for the corresponding row.
I have attempted to use the hlookup function, but keep getting a #ref error (probably because I am just not that familiar with the entire formula requirements).
I attempted to nest in the 'largest' function to the lookup function, but have so far been stymied....
View 14 Replies
View Related
May 27, 2009
When opening a new Excel file, it is asking me for a password to an old excel file that was password protected, which I have deleted from my computer. It is still asking for this password every time I open a new or existing file. When I hit cancel it lets me open the file.
View 11 Replies
View Related
Mar 21, 2007
I have a spreadsheet, which has certain worksheets that are password protected. I need to make changes to some of the formulas, and the VBA modules, however I cannot remember the password!! Is there a way of identifying the password??
View 3 Replies
View Related
Nov 28, 2008
I am havng problems with the belwo macro code -
Range("G7").Select
Selection.Copy
Workbooks.Open Filename:= _
"Q:PublicPAYMENTS Q&RREPORTSSuspense Activity BUSINESS2008 - Suspense BUSINESS - Activity Reports2008 Avon.xls"
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
When i open the workbook it requires me to insert a password, i tried to type this but excel will not follow keystrokes, i then inserted the password in cell G7 which i then copy and paste, which you can see the copy at the beginning of the macro.
Is there a way where you can get it to insert the password so i can open the workbook in a macro.
What im trying to do is save 26 suspense spreadsheets by just clicking on a macro.
View 9 Replies
View Related
Jan 12, 2007
I have a sheet that is password protected. I have this code attached to a command button. It will unlock the worksheet, autofilter it, print it, unfilter it, and password protect the sheet again. However it is protecting it without a password. I need to have it protected with the password so that someone will not be able to just go to tools to unprotect the sheet.
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect "rainforest"
Columns("O:O").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">0", Operator:=xlAnd
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.AutoFilter Field:=1
Selection.AutoFilter
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
End Sub
View 3 Replies
View Related
May 29, 2008
I have Timesheet workbooks with 3 levels of access (user, viewer & me as developer).
I want use the GetuserName API function (with If/Then) to auto open the wkbk if I am loged in under my network login so psuecode looks bit like this
If network user is me then open wkbk
else ask for username & password
I have googled & searched the forum & the closest I have is this
Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function ReturnUserName() As String
' returns the NT Domain User Name
Dim rString As String * 255, sLen As Long, tString As String
tString = ""
On Error Resume Next...............
View 9 Replies
View Related
Nov 10, 2006
I've got a sheet with a "Last Edited By:" field and I want this to be populated with the current users name i.e. I suppose I mean the user name that is assigned to Excel, as opposed to the XP log in... although I guess either would do. I'm OK on the change event thing, but just dont know the function to find the the current users name.
View 3 Replies
View Related
Sep 1, 2007
I recived the small job of making a template for my company for travel. I had spare time so I added in a feature so they can just e-mail it to the approite person from clicking a command button intead of taking the time to click the built in excel e-mail function and typing the addresse.
Anyway, this from tells the person who it is being e-mail to, what flights to book.
I have differnt command buttons to bring up differnt airline webpages, bascially a hyperlink but in command button form. Is there a way, just because i have time, to take the flying dates from excel, input them into the webpage which the command brings up, and search for the flights for that date, just by clicking a button in excel?
I am using excel VB for the little code I have
View 9 Replies
View Related