PDA

View Full Version : Sleeper: Login internet and import image



geep1980
09-14-2010, 07:37 AM
For my work I am making a spreadsheet that collects images from the internal web.
This is working fine for 5 of the 7 images. The last 2 images can only be obtained by first doing:
Data --> From Web and loging into the application

Is is possible to automate the loging in when trying to obtain the images.
The code I am using now is


import_counter = 1
Do While import_counter < Application.CountIf(Sheets("Sheet2").Range("$A$1:$A$10"), ">""") + 1
Set ImportGraph = Worksheets("Sheet2").Range("Sheet2!$A$" & import_counter)
PictureURL = ImportGraph
If Sheet3.Shapes.Count = 0 Then
With Sheet3.Pictures.Insert(PictureURL)
.Left = Sheet3.Range("$A$1").Left
.Top = Sheet3.Range("$A$1").Top
Application.ScreenUpdating = True
End With
Else
With Sheet3.Pictures.Insert(PictureURL)
.Left = Sheet3.Range("$A$" & (Sheet3.Shapes.Count - 1) * 14).Left
.Top = Sheet3.Range("$A$" & (Sheet3.Shapes.Count - 1) * 14).Top
Application.ScreenUpdating = True
End With
End If
import_counter = import_counter + 1
Loop
Else
import_counter = 1
Do While import_counter < Application.CountIf(Sheets("Sheet2").Range("$A$1:$A$10"), ">""") + 1
Set ImportGraph = Worksheets("Sheet2").Range("Sheet2!$A$" & import_counter)
PictureURL = ImportGraph
If Sheet3.Shapes.Count = 0 Then
With Sheet3.Pictures.Insert(PictureURL)
.Left = Sheet3.Range("$A$1").Left
.Top = Sheet3.Range("$A$1").Top
Application.ScreenUpdating = True
End With


the images that can't be obtained have a link simular to the one below

our server /cactie/graph_image.php?action=view&local_graph_id=129&rra_id=3

Is it possible to obtain this images without having to login manually before starting the macro.

Thanks in advanced