ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update Website from Excel ??!!?? (https://www.excelbanter.com/excel-programming/330179-update-website-excel.html)

[email protected]

Update Website from Excel ??!!??
 
Yup, it's one of those "strange" queries.

I have a workbook that can create a report for numerous clients.
One Client wants to be able to see the up-to-date report whenever he
wants.
So that he cannot see any other client's reports i was hoping that
someone had some bright ideas of how to do this.

I was thinking that i could
* create a workbook that will produce a report for this client (this is
doable)
*each morning when i log in, it will automatically produce a report
with the most up-to-date data. (maybe startup? not sure though).
*After the report is produced another macro will save the report to a
webpage or folder (like yahoo briefcase) overwriting anything else that
has the same name. (is this wishful thinking?)

Any help or advice appreciated.

thanks
George


[email protected]

Update Website from Excel ??!!??
 
Incase anyone else can use it...
(Alot of the code was taken from an example by Jow Was (I think))

This is for the uk site and you need to change userid and password to
whatever yours are.

Sub myWebOpenPW()
'Open site if it requires a PassWord Model!
Dim IE As Object

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

'Go to this Web Page!
IE.navigate
"http://login.yahoo.com/config/login?new=1&.intl=uk&.done=http%3a//uk.f1.pg.briefcase.yahoo.com/&.src=bc&referer=&partner="


'Check for good connection to web page loop!
Do
If IE.ReadyState = 4 Then
IE.Visible = False
Exit Do
Else
DoEvents
End If
Loop

'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
'MsgBox "Done"
IE.Visible = True

'Send logg-on information!
'May need additional SendKeys as needed?
'Determine by the actual key-stroks needed!

SendKeys "userID", True
SendKeys "{TAB}", True
SendKeys "password", True
SendKeys "{ENTER}", True


'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
'MsgBox "Done"
IE.Visible = True

'Add the file to briefcase
IE.navigate "http://uk.f2.up.briefcase.yahoo.com/edit/--your
ID--/nbc_do_bub_action?.action=upload&.src=bc"

'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
'MsgBox "Done"
IE.Visible = True

x = 0
While x < 9
SendKeys "{TAB}", True
x = x + 1
Wend
SendKeys "{DOWN}", True
SendKeys "{DOWN}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True

SendKeys "{ENTER}", True

'Check for good connection to web page loop!
Do
If IE.ReadyState = 4 Then
IE.Visible = False
Exit Do
Else
DoEvents
End If
Loop

'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
'MsgBox "Done"
IE.Visible = True


x = 0
While x < 9
SendKeys "{TAB}", True
x = x + 1
Wend

'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
'MsgBox "Done"
IE.Visible = True

SendKeys "c:\test.xls"
SendKeys "{ENTER}"

'Give the document time to upload
Application.Wait (Now + TimeValue("0:00:05"))
'MsgBox "Done"
IE.Visible = True

'sign out
IE.navigate
"http://www.yahoo.com/_ylh=X3oDMTB2MXQ5MTU3BF9TAzI3MTYxNDkEdGVzdAMwBHRtc GwDaW5kZXgtaWU-/r/l5"


IE.Quit

End Sub


Hope this helps someone.
George



All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com