I am writing some VBA to take data from excel into eviews:
Code: Select all
Dim shReadMe As Worksheet, shWorkingAdd As Worksheet
Dim mgr As New EViews.Manager
Dim app As EViews.Application
Dim Path As String, SeriesName As String
Dim rngAdjustedProfile As Range
Set shReadMe = Worksheets("READ ME")
Set shWorkingAdd = Worksheets("Working AddFactors")
Set app = mgr.GetApplication(ExistingOrNew)
Path = shReadMe.Range("PATH")
Set rngAdjustedProfile = shWorkingAdd.Range("Q8:X8")
SeriesName = shWorkingAdd.Range("VARIABLE")
app.Run "wfopen """ & Path & "\output\Model.wf1"""
app.Run "smpl 2020q2 2022q2"
app.Put SeriesName, rngAdjustedProfile, DataTypeSeries
Everything works, except the app.put call doesnt seem to read in the range of data, but only the first observation, so in this instance the data in cell Q8 in shWorkingAdd. I have changed the cell reference and every time it is the same, reading in only the first observation in the range - NAs for everything else.
I also have tried app.PutSeries with no avail.
I am using Eviews 10+ and Excel 2016.
Any thoughts as to where I am going wrong?