View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Get right Excel application

Thisworkbook would only be applicable if the code is being run from the
workbook you want to refer to.

T(iTab).SheetName

seems a bit strange. What is T. At least through Excel 2003, I don't
believe there is any object that has a sheetname property.

--
Regards,
Tom Ogilvy




"Alex St-Pierre" wrote:

Hi !
In Excel, when 2 differents Excel.Application, there's an error with these
lines.
Set oExcel = GetObject(, "Excel.Application")
Set oWb = oExcel.ThisWorkbook 'ERROR 1004..
Set oXlRng = oWb.Sheets(T(iTab).SheetName).Range("TableOutput")
I'm wondering if I could just say:
Set oXlRng = ThisWorkbook.Sheets(T(iTab).SheetName).Range("Tabl eOutput")
and defined oXlRng as a Range. Should I declare Excel.Range if the word
library are open into Excel?
Thanks!
Alex

--
Alex St-Pierre