Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using Script to download from secure site

Hello all! Is it possible to configure a script in Excel that will download
a dynamic report from a secure site? We have a list of vendors that is
updated regularly from our service supplier, and a report posted in Crystal
Reports to the secure extranet. I'd like to use a script in Excel to open
the appropriate page, sign in using my credentials, browse to the report and
import the results into a spreadsheet, then comare the newly generated list
against our internal list to see if any of the changes pertain to us. Is
this possible? MS says that the web query doesn't work from secure sites,
but I'm wondering if I can program the script to some kind of step-by-step
instructions that would enter the commands as if I were at my keyboard.
Appreciate any help,
GP
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Using Script to download from secure site

This can be done, but it is tricky. If you send me some details I
could help you out.

I would start by modifying this function I use:

Function Get_Online_Report()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "https://Your Site Name Here"
Do Until .readystate = 4
DoEvents
Loop
With .document.forms(0)
.Item("UserName").Value = "Your UserName Here"
.Item("Password").Value = "Your Password Here"
.Item("The Submit Button").Click
End With
End With
Set ie = Nothing
End Function

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Using Script to download from secure site

Dave,
I have the same problem as you were discussing below, downloading my account
data from my secure broker's site. I tried both Web Query and Macro and got
stopped right at the login step. Can I use your script and how do I run it in
my case, since I have to login then go to another page and download from that
page data that is only contained in one frame?

Thanks for your help.
--
XL Baby


"Dave Miller" wrote:

This can be done, but it is tricky. If you send me some details I
could help you out.

I would start by modifying this function I use:

Function Get_Online_Report()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "https://Your Site Name Here"
Do Until .readystate = 4
DoEvents
Loop
With .document.forms(0)
.Item("UserName").Value = "Your UserName Here"
.Item("Password").Value = "Your Password Here"
.Item("The Submit Button").Click
End With
End With
Set ie = Nothing
End Function


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Using Script to download from secure site

Again, I would need a specific site inorder to help you out.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Using Script to download from secure site

Dave,
The specific site is:
www.schwab.com
Thanks.
--
XL Baby


"Dave Miller" wrote:

Again, I would need a specific site inorder to help you out.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Using Script to download from secure site

XL Baby,

This should work for you, watch out for word wrap though:

-just change the variable to your username and password

Regards,
David Miller

Function Get_Online_Report()
Dim ie, Form As Object, _
sUserName, sPassword As String

Set ie = CreateObject("InternetExplorer.Application")

sUserName = "Your User Name"
sPassword = "Your Password"

With ie
.Visible = True
.navigate "https://investing.schwab.com/trading/start?kc=y"
Do Until .readystate = 4
DoEvents
Loop
On Error Resume Next
With .Document.Forms
For I = 0 To .Length - 1
If .Item(I).Name = "SignonForm" Then
Set Form = .Item(I)
End If
Next
With Form
For I = 0 To .Length - 1
With .Item(I)
Select Case .Name
Case "SignonAccountNumber"
.Value = sUserName
Case "SignonPassword"
.Value = sPassword
End Select
End With
Next
.Submit
End With
End With
End With
Set ie = Nothing
End Function


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Using Script to download from secure site

Thanks, Dave.
Now, how do I use this function? By itself, as part of a WebQuery or inside
of a Macro? Also, what is the problem with wordwrap?
--
XL Baby


"Dave Miller" wrote:

XL Baby,

This should work for you, watch out for word wrap though:

-just change the variable to your username and password

Regards,
David Miller

Function Get_Online_Report()
Dim ie, Form As Object, _
sUserName, sPassword As String

Set ie = CreateObject("InternetExplorer.Application")

sUserName = "Your User Name"
sPassword = "Your Password"

With ie
.Visible = True
.navigate "https://investing.schwab.com/trading/start?kc=y"
Do Until .readystate = 4
DoEvents
Loop
On Error Resume Next
With .Document.Forms
For I = 0 To .Length - 1
If .Item(I).Name = "SignonForm" Then
Set Form = .Item(I)
End If
Next
With Form
For I = 0 To .Length - 1
With .Item(I)
Select Case .Name
Case "SignonAccountNumber"
.Value = sUserName
Case "SignonPassword"
.Value = sPassword
End Select
End With
Next
.Submit
End With
End With
End With
Set ie = Nothing
End Function



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Using Script to download from secure site

All this function does is get you through the door. I can not go any
further with this because I do not have access to this site.

To use:
-Paste the function into a module
-Then call it from another procedu

Sub OpenWebSite()
Call Get_Online_Report
End Sub


go back to the worksheet and press Alt + F8 then select OpenWebSite
and click Run.


Regards,
David Miller

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Using Script to download from secure site

Dave,

I tried to implement your suggestion above, but I keep getting a "Syntax
Error" as soon as I run it. Can you tell me what is going on please? Tks a
lot.
--
XL Baby


"Dave Miller" wrote:

All this function does is get you through the door. I can not go any
further with this because I do not have access to this site.

To use:
-Paste the function into a module
-Then call it from another procedu

Sub OpenWebSite()
Call Get_Online_Report
End Sub


go back to the worksheet and press Alt + F8 then select OpenWebSite
and click Run.


Regards,
David Miller


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default Using Script to download from secure site

In many cases, I've found that manually doing a Web Query creates a
cookie that allows me to download data from the site after that with
little or no problem. I have an add-in that extracts financial data
from web pages, so I've had to use it on a few secure pages. But once
the cookie was established via the Web Query, all of the web pages
from that site have been available.

On May 11, 4:14 am, XL Baby wrote:

I have the same problem as you were discussing below, downloading my account
data from my secure broker's site. I tried both Web Query and Macro and got
stopped right at the login step. Can I use your script and how do I run it in
my case, since I have to login then go to another page and download from that
page data that is only contained in one frame?




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Using Script to download from secure site

If you post the entire code you are trying to run I will be able to
help you.

Regards,
Dave

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Script to download from secure site

On 8 jun, 14:34, Dave Miller wrote:
If you post the entire code you are trying to run I will be able to
help you.

Regards,
Dave


Hi my name is edgar. I've got the same question or looks alike:
I'm opening a intranet webpage as a workbook. With the command:
woorkbooks.open("http//intranet.net/id=XX")
In that very moment a Dialog box prompts me asking for UserId and
Password, I provide them and the workbook is created ok.
Question: How can I insert code to provide this information to the
dialog box? and avoid the manual part, cause I have some pages to open
this way.

I was trying the function written in lines before working with an ie
object.
Now I can open the ie object webpage, even without provide UserId and
password
I'm thinking I could get the specific information I need from this ie
Object, But,
One thing is that I don't know how the ie object methods and
properties
work, basically cause I don't have it referenced in Excel Library, I
don't
see a file or dll for that in the references library. For example to
use a
find method in the ie object and then to refer to the field/cell next
to the
parameter that I'm requesting with the find method.

In a sheet i could do it, but again when i execute
workbooks.open("http//aaaa/.bbb.com"), in that moment and part of the
code it
prompts me with the logon dialog box. I guess Excel got a cookie like
Randy
mentioned before cause now I see the values already provided into the
form,
but the i have the Enter command. I mean do not have an idea how to
work it
around, even when I open the webpage with the ie object function.

But If you have any idea or know who could help on this, I mean Very
much Thank you really.

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default Using Script to download from secure site

You need to submit the form through the IE object, typically using a
"click" method. There are many examples on the Internet (I had to
find them using Google when I first learned how to do it). Here is a
short example I posted on the newsgroup befo

http://groups.google.com/group/micro...4359a6cdfd76ef

wrote:
Randy mentioned before cause now I see the values already provided into the
form, but the i have the Enter command. I mean do not have an idea how to
work it around, even when I open the webpage with the ie object function.

But If you have any idea or know who could help on this, I mean Very
much Thank you really.


  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Using Script to download from secure site

Edgar,

In the VBE you need to use the Locals window to view properties of the
ie object. Step through your code until you have the ie object
initiated. Go to the locals window start drilling down from the ie
object -- Document -- Forms -- Item 1 If this form item has a value
in the id property, it can be referenced directly in code, e.g. Set
oForm = ie.document.all.item("FormID")

If not you will need to loop through all the forms to identify it by
name;

with ie.document.forms
for i = 0 to .length
if .item(i).name like "Your Form Name"
set oForm = .item(i)
end if
next
end with


The locals window will give you a treeview of any objects properties,
learn to use it and you will be amazed by how much easier programming
is.

Regards,
David Miller

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import from a secure site botha Excel Discussion (Misc queries) 1 June 20th 06 07:16 PM
Can't Download Data in Thai Script Victor Viguilla Excel Discussion (Misc queries) 0 June 1st 06 03:51 AM
Download a CSV file from an internet site Microchip Excel Programming 0 March 28th 06 12:41 PM
Looking for Userform examples - site on web, download examples thom hoyle Excel Programming 1 May 10th 05 05:23 PM
Correct a Stock Option Download Script JB[_2_] Excel Programming 1 September 16th 03 03:23 PM


All times are GMT +1. The time now is 09:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"