Hi,
Basically I have script that collects data from various sources and passes it into a Data Dictionary called DictData; but I’m having trouble writing it back into a spreadsheet.
The keys represent cell references such as A1, C3, D18, etc… and the items are the data I want to populate into the given cell.
In it of if self, the data looks fine and so do the keys, but the dws.Range(mapRef).Value = currCellData call keeps producing an UNKNOWN runtime Error 800A03EC…
I tried using the array variable: currCellRef(indx), that returns for example, A1 (no dbl quotes)
I also tried passing it into a new variable: mapRef, returning the same as above, errors
I even tried adding the chr(34) (or “) to the front and back of the new variable – although it’s now returning “A1” with the dbl quotes, it still errors…
AND tried cstr()... but still receiving the same error
Any ideas?????
Thanks in advance
---------------------------
Set dFSO = CreateObject("Scripting.FileSystemObject")
Set dXL = CreateObject("Excel.Application")
dXL.UserControl = False
dXL.Visible = False
Set dwb = dXL.workbooks.open(fnCaviumImport)
Set dws = dXL.worksheets(1)
dws.Activate
currCellRef = DictData.keys 'Get the keys
For indx = 0 To DictData.Count -1 'Iterate the array
mapRef = cstr(currCellRef(indx))
mapRef = chr(34) & mapRef & chr(34)
If DictData.Exists(currCellRef(indx)) Then
currCellData = DictData.Item(currCellRef(indx))
dws.Range(cstr(mapRef)).Value = currCellData <-- Error
end If
indx = indx + 1
Next
dwb.Save
dwb.Close
Set dwb = Nothing
dXL.Quit
Set dXL = Nothing
---------------------------
Basically I have script that collects data from various sources and passes it into a Data Dictionary called DictData; but I’m having trouble writing it back into a spreadsheet.
The keys represent cell references such as A1, C3, D18, etc… and the items are the data I want to populate into the given cell.
In it of if self, the data looks fine and so do the keys, but the dws.Range(mapRef).Value = currCellData call keeps producing an UNKNOWN runtime Error 800A03EC…
I tried using the array variable: currCellRef(indx), that returns for example, A1 (no dbl quotes)
I also tried passing it into a new variable: mapRef, returning the same as above, errors
I even tried adding the chr(34) (or “) to the front and back of the new variable – although it’s now returning “A1” with the dbl quotes, it still errors…
AND tried cstr()... but still receiving the same error
Any ideas?????
Thanks in advance
---------------------------
Set dFSO = CreateObject("Scripting.FileSystemObject")
Set dXL = CreateObject("Excel.Application")
dXL.UserControl = False
dXL.Visible = False
Set dwb = dXL.workbooks.open(fnCaviumImport)
Set dws = dXL.worksheets(1)
dws.Activate
currCellRef = DictData.keys 'Get the keys
For indx = 0 To DictData.Count -1 'Iterate the array
mapRef = cstr(currCellRef(indx))
mapRef = chr(34) & mapRef & chr(34)
If DictData.Exists(currCellRef(indx)) Then
currCellData = DictData.Item(currCellRef(indx))
dws.Range(cstr(mapRef)).Value = currCellData <-- Error
end If
indx = indx + 1
Next
dwb.Save
dwb.Close
Set dwb = Nothing
dXL.Quit
Set dXL = Nothing
---------------------------