Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cells Range Error - URGENT
HELP Having a serious problem with CELL qualifications ... xlExcel.Range(Cells(TrackRow, TrackCol), Cells(TrackRow, TrackCol + SelectedCount - 1)).HorizontalAlignment = xlCenter This line, for example, will work fine 1st time through the Access application to generate an excel sheet, but if you try and re-run WITHOUT shutting the app down first, gives the error "method 'CELLS' of object _Global failed", but all other statements using xlExcel seem to work ok. XlExcel quits and set to nothing at end of app, so stumped. Someone mentioned may be an error with CELLS statement. Any takers ...? Thanks, Steve -- Digicelt ------------------------------------------------------------------------ Digicelt's Profile: http://www.excelforum.com/member.php...o&userid=30392 View this thread: http://www.excelforum.com/showthread...hreadid=500545 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cells Range Error - URGENT
Hi Steve
Cells should be qualified to the worksheet. Dim xlWks as excel.Worksheet ' add a new sheet Set xlWks = xlExcel.Workbooks("myBook.xls").Worksheets.Add ' or an existing sheet 'Set xlWks = xlExcel.Workbooks("myBook.xls").Worksheets.("Sheet 1") With xlWks ..Range(.Cells(TrackRow, TrackCol), .Cells(TrackRow, TrackCol + SelectedCount - 1)).HorizontalAlignment = xlCenter End With Regards, Peter T "Digicelt" wrote in message ... HELP Having a serious problem with CELL qualifications ... xlExcel.Range(Cells(TrackRow, TrackCol), Cells(TrackRow, TrackCol + SelectedCount - 1)).HorizontalAlignment = xlCenter This line, for example, will work fine 1st time through the Access application to generate an excel sheet, but if you try and re-run WITHOUT shutting the app down first, gives the error "method 'CELLS' of object _Global failed", but all other statements using xlExcel seem to work ok. XlExcel quits and set to nothing at end of app, so stumped. Someone mentioned may be an error with CELLS statement. Any takers ...? Thanks, Steve -- Digicelt ------------------------------------------------------------------------ Digicelt's Profile: http://www.excelforum.com/member.php...o&userid=30392 View this thread: http://www.excelforum.com/showthread...hreadid=500545 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Collection from Range, tag cells on error | Excel Programming | |||
Given a range of cells, some of which contain errors (e.g. #DIV/0), replace each cell having an error with the value of a non-error precedent cell | Excel Programming | |||
How do you sum a range of more than 30 cells. I get error each time I try. | Excel Worksheet Functions | |||
Drillthrough MDX ERROR(Error.Number:-21467259) ?(urgent question) | Excel Programming | |||
sum a range of cells that include an error | Excel Discussion (Misc queries) |