omnibuster
10-15-2011, 03:12 PM
Welcome.
I have strange situation?
My code works fine years, but monday it stop works?:banghead:
This is fragment of code.
For Each vIE In SWs
If Left(vIE.LocationURL, 4) = "http" Then
Set vIEDoc = vIE.Document
For i = 0 To vIEDoc.links.Length - 1
found = False
With vIEDoc
If Right(vIEDoc.links(i).href, 7) = "english" Then
found = True
todaysURL = vIEDoc.links(i).href
If found Then
Workbooks.Open todaysURL
'error: Method 'Open' of object 'Workbooks' failed
Stop
GoTo 10
End If
End If
End With
Next i
End If
Next
I tried go to other-short way, but stuck here: how open CSV-file in website?
URL = Range("A" & i)
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = 1
.Navigate URL
Do While .Busy: DoEvents: Loop
' DoEvents
' How open CSV file for copy to Excel?
' ActiveWorkbook.SaveAs Filename:="AEG.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End With
I have strange situation?
My code works fine years, but monday it stop works?:banghead:
This is fragment of code.
For Each vIE In SWs
If Left(vIE.LocationURL, 4) = "http" Then
Set vIEDoc = vIE.Document
For i = 0 To vIEDoc.links.Length - 1
found = False
With vIEDoc
If Right(vIEDoc.links(i).href, 7) = "english" Then
found = True
todaysURL = vIEDoc.links(i).href
If found Then
Workbooks.Open todaysURL
'error: Method 'Open' of object 'Workbooks' failed
Stop
GoTo 10
End If
End If
End With
Next i
End If
Next
I tried go to other-short way, but stuck here: how open CSV-file in website?
URL = Range("A" & i)
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = 1
.Navigate URL
Do While .Busy: DoEvents: Loop
' DoEvents
' How open CSV file for copy to Excel?
' ActiveWorkbook.SaveAs Filename:="AEG.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End With