Hello,
The following is a code extract causing the issue:
I can use the ranges without any issues directly or via their names. However the Union statements both result in ""Runtime error 1004_ Method Union of Object _Global failed".
Does anyone have any ideas?
Thanks
Jon
The following is a code extract causing the issue:
VBA Code:
' WBData is the Excel workbook object and WSData the worksheet object in the workbook
' Set the 2 ranges (no issues here)
Set HdrTblRange = WSData.Range(WSData.Cells(cs_Row_Headers, 1), WSData.Cells(cs_Row_Headers, cs_Col_FCSubmission))
Set DataTblRange = WSData.Range(WSData.Cells(DRow + cs_Row_Headers, 1), WSData.Cells(DRow + cs_Row_Headers, cs_Col_FCSubmission))
' Give each range a name (no issues either)
WBData.Names.Add "FCHdr", HdrTblRange
WBData.Names.Add "FCData", DataTblRange
' The following statements result in a "Runtime error 1004_ Method Union of Object _Global failed"
Set UnionRange = Union(HdrTblRange, DataTblRange)
Set UnionRange = Union(WSData.Range("FCHdr"), WSData.Range("FCData"))
I can use the ranges without any issues directly or via their names. However the Union statements both result in ""Runtime error 1004_ Method Union of Object _Global failed".
Does anyone have any ideas?
Thanks
Jon