sathish_fun
Board Regular
- Joined
- Feb 15, 2008
- Messages
- 247
Hi All
i am trying to get data from a url and the URL belongs to my company the below code is working and i am able to retrieve data and print in excel but some times i am getting Run Time error 1004 and on debug it is stopping on (.Refresh BackgroundQuery:=False)
can some one help me to solve my problem
Error details
Code i am using
i am trying to get data from a url and the URL belongs to my company the below code is working and i am able to retrieve data and print in excel but some times i am getting Run Time error 1004 and on debug it is stopping on (.Refresh BackgroundQuery:=False)
can some one help me to solve my problem
Error details
HTML:
1004 -- The file could not be accessed. Try one of the following:
• Make sure the specified folder exists.
• Make sure the folder that contains the file is not read-only.
• Make sure the file name does not contain any of the following characters: < > ? [ ] : or *
• Make sure the file/path name doesn't contain more than 218 characters.
HTML:
a = Range("Z1").Value
With ActiveSheet.QueryTables.Add(Connection:="URL;http://10.101.8.127:8000/webcmd/devicecap?msisdn=91" & a & "&hardware_gprs&msisdn&brand&model", Destination:=Range("$A$1"))
.Name = "q?s=goog_2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1,2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With