R
RzB
I have read may posts about Excel application not
closing properly, and have been very careful to make
sure that my application uses fully qualified references
to Excel objects. That has worked fine so far....
However I would like to be able to use the Cells
property to refer to certain ranges. If I uses Cells
the Excel file will not close properly.
For example if I use this ....
Private m_rngCurrentRange As Excel.Range
Set m_rngCurrentRange = m_objXlSht.Range("C3").
m_rngCurrentRange.Range("B2", "C5").HorizontalAlignment = xlCenter
all is well.... However if I use....
m_rngCurrentRange.Range(Cells(2,2), Cells((3,5) ).HorizontalAlignment =
xlCenter
Then excel does not close properly...
How do I overcome this... I don't want to have to program
column letters at text!!!
Many thanks,
Roy
closing properly, and have been very careful to make
sure that my application uses fully qualified references
to Excel objects. That has worked fine so far....
However I would like to be able to use the Cells
property to refer to certain ranges. If I uses Cells
the Excel file will not close properly.
For example if I use this ....
Private m_rngCurrentRange As Excel.Range
Set m_rngCurrentRange = m_objXlSht.Range("C3").
m_rngCurrentRange.Range("B2", "C5").HorizontalAlignment = xlCenter
all is well.... However if I use....
m_rngCurrentRange.Range(Cells(2,2), Cells((3,5) ).HorizontalAlignment =
xlCenter
Then excel does not close properly...
How do I overcome this... I don't want to have to program
column letters at text!!!
Many thanks,
Roy