LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,805
Default How to store a reference of a excel workbook in a variable in

I am happy that it worked for you.

Essentially once you get a reference to Excel by
Set objExcel = CreateObject("Excel.Application")
you can get a reference to any Excel object (Workbooks, Worksheets,
Range,...) through objExcel...



"Store a reference of a excel workbook" wrote:

Thank you very much Sheeloo. Its Working :)

"Sheeloo" wrote:

Use this
Const xlDelimited = 1
Set objExcel = CreateObject("Excel.Application")


fOpen=objExcel.Workbooks.OpenText
("C:\Scripts\Test1.txt",,,xlDelimited,,,,,,,True," ,")


objExcel.Visible = True

if fOpen=true Then
set wb=objExcel.Workbooks("Test.txt")
wb.Sheets("Test").Range("A1").Value="Code OK"
end if



 
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
Retrieving data from Excel and store it into string variable marsulein[_5_] Excel Programming 1 November 10th 04 01:43 AM
Retrieving data from Excel and store it into string variable marsulein[_4_] Excel Programming 1 November 9th 04 09:35 AM
Retrieving data from Excel and store it into string variable marsulein Excel Programming 2 November 9th 04 08:44 AM
Retrieving data from Excel and store it into string variable marsulein[_3_] Excel Programming 1 November 9th 04 04:47 AM
Retrieving data from Excel and store it into string variable marsulein[_2_] Excel Programming 1 November 9th 04 02:04 AM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"