LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Excel automation: connecting to Excel

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


 
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
connecting wordpad and excel Jan Excel Discussion (Misc queries) 1 May 4th 07 01:37 PM
Connecting excel to the weblink Igneshwara reddy[_2_] Excel Programming 4 March 6th 07 10:39 PM
EXCEL-VBA, ADO not connecting to a TXT file coco Excel Programming 1 June 17th 05 04:59 AM
Excel connecting to Teradata Bill Excel Programming 3 March 31st 05 08:47 PM
Connecting to SQL from Excel Keith La Force Excel Programming 4 March 2nd 05 09:27 PM


All times are GMT +1. The time now is 09:21 AM.

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"