venkat1926
Well-known Member
- Joined
- Aug 21, 2005
- Messages
- 4,824
I have the following code
the red color lines give error "unable to open.............". when I click ok in the error emssage and go further the
higher size lines work and download the data for the period.
what mistake am I doing in the codes above the line '------------
particularly red colored lines?
I can think that there are doube quotes in the hgher size code lines and wonder whether these give problem.
thank you
the red color lines give error "unable to open.............". when I click ok in the error emssage and go further the
higher size lines work and download the data for the period.
what mistake am I doing in the codes above the line '------------
particularly red colored lines?
I can think that there are doube quotes in the hgher size code lines and wonder whether these give problem.
thank you
Code:
Sub data2()
stock = "adhunik"
Dim constring As String
dte1 = "06-12-2008"
dte2 = "06-02-2009"
constring = "URL;http://nseindia.com/content/equities/scripvol/datafiles/" & dte1 & "-TO-" & dte2 & stock & "XN.csv"
'MsgBox constring
[SIZE="4"][COLOR="Red"]With ActiveSheet.QueryTables.Add(Connection:=constring, Destination:=Range("A1"))
.Refresh
End With[/COLOR][/SIZE]
'============================
[FONT="Arial Black"][SIZE="5"]wiith ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://nseindia.com/content/equities/scripvol/datafiles/06-12-2008-TO-06-02-2009ADHUNIKXN.csv" _
, Destination:=Range("A1"))
.Refresh
End With[/SIZE][/FONT]
End Sub