Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reading complete Excel using DDE code


Hello All,

I am able to sucessfully read contents of excel file using DDE command
with parameter R1C1:R10C10 i.e. by giving the start and end number of
columns and rows.

What if I dont know the start and the end number and I want to read the
entire document in one go.

Is there a command to read the complete Content of a single sheet from
a excel file in one go ?

I am aware that I could iterate through the rows and columns untill I
stop getting more data but in this particular case it is impractical as
the excel sheet is too large and take about 30 mins to iterate through
it.

Thanks for your help in advance.
-Amit


--
amitkrsingh
------------------------------------------------------------------------
amitkrsingh's Profile: http://www.excelforum.com/member.php...o&userid=26359
View this thread: http://www.excelforum.com/showthread...hreadid=396242

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Reading complete Excel using DDE code

Hi,

you can select cell range by using excel4 macro function in DDE.
the following is an example for word 2000 vba:

Sub DDE_Test()
Dim ch As Integer, ch2 As Integer
Dim Sel As Variant, Ret As Variant

ch = DDEInitiate("Excel", "System")
DDEExecute ch, "[FORMULA.GOTO(""[Book1.xls]Sheet1!R1C1"")]"
DDEExecute ch, "[SELECT.SPECIAL(5)]" 'select a current region
Sel = DDERequest(ch, "Selection")
Sel = Split(Sel, "!")
DDETerminate ch

ch2 = DDEInitiate("Excel", Sel(0))
Ret = DDERequest(ch2, Sel(1))
'Selection.InsertAfter Ret
DDETerminate ch2
End Sub


the reference on macro function is he

http://www.microsoft.com/downloads/d...0-5d03748ca5cd
http://support.microsoft.com/kb/143466/EN-US/

--
HTH,

okaizawa



amitkrsingh wrote:
Hello All,

I am able to sucessfully read contents of excel file using DDE command
with parameter R1C1:R10C10 i.e. by giving the start and end number of
columns and rows.

What if I dont know the start and the end number and I want to read the
entire document in one go.

Is there a command to read the complete Content of a single sheet from
a excel file in one go ?

I am aware that I could iterate through the rows and columns untill I
stop getting more data but in this particular case it is impractical as
the excel sheet is too large and take about 30 mins to iterate through
it.

Thanks for your help in advance.
-Amit


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
Auto Complete (???) in Excel Alison Excel Worksheet Functions 1 December 4th 07 09:15 PM
Excel cannot complete this task starguy Excel Discussion (Misc queries) 7 April 14th 06 11:52 AM
Complete a "helpsheet" code Jonsson[_22_] Excel Programming 1 April 27th 04 01:19 PM
Complete Excel App? Advantages? George[_17_] Excel Programming 2 December 9th 03 04:06 PM
Excel Reading Fredrick Excel Programming 1 September 17th 03 06:20 AM


All times are GMT +1. The time now is 12:14 PM.

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"