Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Retrieving data from Excel and store it into string variable


Dim strTemp As String
Dim objExcel As Object
Dim cnnExcel As String

strTemp = objExcel.Fields("Resource").Value


I open the connection this way:

cnnExcel = "driver={Microsoft Excel Driver (*.xls)};" & _
"dbq=<*some path*;" & _
"Extended Properties=""Exce
8.0;HDR=Yes"""

objExcelAdd.Open "SELECT * FROM [New To be added$]", cnnExcel, 1,

--
marsulei
-----------------------------------------------------------------------
marsulein's Profile: http://www.excelforum.com/member.php...fo&userid=1606
View this thread: http://www.excelforum.com/showthread.php?threadid=27520

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Retrieving data from Excel and store it into string variable

marsulein
If objExcel refers to an instance of Excel, how are you creating/assigning
it ? If true, then Excel does not have a ".Fields" property.

What is objExcelAdd ?

I'm a little confused as to what you are trying to do, so please clarify the
you want to get data from an Excel sheet in to VB using ADO ?

NickHK


"marsulein" wrote in message
...

Dim strTemp As String
Dim objExcel As Object
Dim cnnExcel As String

strTemp = objExcel.Fields("Resource").Value


I open the connection this way:

cnnExcel = "driver={Microsoft Excel Driver (*.xls)};" & _
"dbq=<*some path*;" & _
"Extended Properties=""Excel
8.0;HDR=Yes"""

objExcelAdd.Open "SELECT * FROM [New To be added$]", cnnExcel, 1, 1


--
marsulein
------------------------------------------------------------------------
marsulein's Profile:

http://www.excelforum.com/member.php...o&userid=16064
View this thread: http://www.excelforum.com/showthread...hreadid=275204



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
To store the formula in a string pol Excel Discussion (Misc queries) 4 December 2nd 08 02:14 PM
retrieving data from variable workbooks lutan Excel Discussion (Misc queries) 3 August 14th 07 01:08 PM
Retrieving Cell Data From Variable Files DJ Pomeroy Excel Worksheet Functions 3 April 24th 07 08:32 PM
Retrieving data from Excel and store it into string variable marsulein Excel Programming 2 November 9th 04 08:44 AM
Store variable value for Chart Al Jager Excel Programming 1 February 19th 04 10:58 AM


All times are GMT +1. The time now is 05:37 PM.

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"