Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to fill a sheet in Excel2003 with CSV data?


I use server-side calculations in an OWC(Office spreadsheet component)
send the resulting data as string (formatted as CSV) to my Client. Ho
can I fast fill an Excelsheet(2003) with this data passed as string
Must I loop through the CSV data? When saved as file (.csv) on th
server I can open the .CSV manually on the client fast like opening a
ordinary .xla file. But how do I do it programmatically when the cs
data is in a string on my VBA client? Cannot find the proper propertie

tmark
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message345904.htm

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to fill a sheet in Excel2003 with CSV data?

I don't know much about the Office spreadsheet component, but it might be
easier to pick up you data as an array in a variant and write it out the
same way

Pseudocode follows:

Dim vArr as Variant

vArr = OWC.Range("A1:Z200")

then on the client side

ActiveSheet.Range("A1").Resize(ubound(varr,1),ubou nd(varr,2)).Value = _
vArr

--
Regards,
Tom Ogilvy

"tmarko" wrote in message
...

I use server-side calculations in an OWC(Office spreadsheet component) I
send the resulting data as string (formatted as CSV) to my Client. How
can I fast fill an Excelsheet(2003) with this data passed as string.
Must I loop through the CSV data? When saved as file (.csv) on the
server I can open the .CSV manually on the client fast like opening an
ordinary .xla file. But how do I do it programmatically when the csv
data is in a string on my VBA client? Cannot find the proper properties


tmarko
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message345904.html



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to fill a sheet in Excel2003 with CSV data?


Hi Tom Ogilvy!

I cannot get your code working. The spreadsheet info is not importan
after all just info why I pass CSV data to the Client.

I want to populate an Excelsheet with CSV data from this string as fas
as possible (Excel2003). I was hoping for a property that is found i
Worksheet or something to fill the sheet. Instead of looping throug
the file beacuse when open up a .SCV file everything seems to go b
magic. But I do not want to involve a file in my application.

Thanks anywa

tmark
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message345904.htm

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to fill a sheet in Excel2003 with CSV data?

The closest you could come is to get the string in the clipboard and then
paste it to the sheet into cell A1 (as an example). This should put all the
data in column A, then you could use the Text to Columns Method under the
Data menu to parse your data into the appropriate columns.

put some data in A1 and A2 like below

123,"abc",345,"cdef","ghij",456
"iii",31111,"rst",1,"mnop",,345

Then turn on the macro recorder

select A1:A2

then do
Data=Text to Columns
Choose delimited and Next
Choose Comma as the separator (if that is your separator)
Then click finish
Turn off the macro recorder

This produces:

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited,
_
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo
_
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1), _
Array(7, 1))

So once you put your string in column 1, you can run this and it should do
the equivalent of opening a csv file.

(change selection to something like
Activesheet.Range("A1").CurrentRegion.TextToColumn s . . .

--
Regards,
Tom Ogilvy



"tmarko" wrote in message
...

Hi Tom Ogilvy!

I cannot get your code working. The spreadsheet info is not important
after all just info why I pass CSV data to the Client.

I want to populate an Excelsheet with CSV data from this string as fast
as possible (Excel2003). I was hoping for a property that is found in
Worksheet or something to fill the sheet. Instead of looping through
the file beacuse when open up a .SCV file everything seems to go by
magic. But I do not want to involve a file in my application.

Thanks anyway


tmarko
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message345904.html



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 fill Certain data from Sheet 1 to Sheet 2 Coje Excel Worksheet Functions 0 January 4th 09 11:05 PM
Drag and fill on a filtered data sheet. Pash Excel Worksheet Functions 6 October 21st 08 07:28 AM
I want help to fill data of sheet 2 in sheet 1 Das (PUNE) Excel Worksheet Functions 1 July 22nd 08 09:35 AM
How can I get more colors to choose from for Fill? Use Excel2003 Inge Excel Discussion (Misc queries) 4 July 27th 06 05:45 PM
pull data from sheet two, then fill in the data to sheet one (part Jim Excel Worksheet Functions 3 December 11th 04 04:51 AM


All times are GMT +1. The time now is 09: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"