Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection from Range, tag cells on error nowon Excel Programming 1 January 3rd 06 12:34 AM
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 Barclay0x00 Excel Programming 3 October 24th 05 05:12 PM
How do you sum a range of more than 30 cells. I get error each time I try. Joseph Conaghan via OfficeKB.com Excel Worksheet Functions 5 March 21st 05 10:15 PM
Drillthrough MDX ERROR(Error.Number:-21467259) ?(urgent question) Microlong Excel Programming 2 March 4th 05 01:55 AM
sum a range of cells that include an error HeatherC Excel Discussion (Misc queries) 2 January 28th 05 10:58 AM


All times are GMT +1. The time now is 03:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"