Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave's post shows how.
Don't forget to check the typename of the sheet you get, in case it's a chart and not a worksheet. Tim "Jack" <replyto@it wrote in message ... Thank you. I need to connect my app to any Excel spreadsheet, which currently is opened. In the case if there are several spreadsheets opened, it does not matter which one will be used. Jack "Tim Williams" <timjwilliams at gmail dot com wrote in message ... They appear to do different things... The first gets a reference to the activesheet, the second (ignoring the duplicate app reference) gets a reference to the first sheet of the first workbook. Can you provide some context around what you want to do? Tim "Jack" <replyto@it wrote in message ... Which one is better (safer) way to do: 1. If moExcelApp.Workbooks.Count 0 Then 'when any sheet is opened Set moExcelWS = moExcelApp.ActiveWorkbook.ActiveSheet End if or 2. If moExcelApp.Workbooks.Count 0 Then 'when any sheet is opened Set moExcelWS = moExcelApp.moExcelApp.Workbooks(1).Worksheets(1) End if Jack |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
connecting wordpad and excel | Excel Discussion (Misc queries) | |||
Connecting excel to the weblink | Excel Programming | |||
EXCEL-VBA, ADO not connecting to a TXT file | Excel Programming | |||
Excel connecting to Teradata | Excel Programming | |||
Connecting to SQL from Excel | Excel Programming |