Copying Data from an Excel file when Excel is not running

  • Thread starter Colleyville Alan
  • Start date
C

Colleyville Alan

Is there a way in code to copy data out of an Excel file even if Excel is
not up and running? If Excel were open, I'd copy, say, the first 30 rows
and paste the info to PowerPoint. Then, since rows 1-5 are for column
headings, I'd hide rows 6-30 and copy a new range which would look involve
30 rows, but since rows 6-30 were hidden would be 1-5 and then 31-55, making
the selection appear as a
contiguous block.

I am trying to do this in VBA without opening Excel and instatiating
objects, etc. Is it possible? What VBA commands would I use?


p.s. I apologize for lack of nettiquette as this question was accidentally
posted in another newsgroup as well
 
C

Cindy M -WordMVP-

Hi Colleyville,

You can access the data in an Excel file without opening it using ADO (ActiveX
Data Objects) or the JET engine (DAO). Then you'd have to automate building
the table in Powerpoint and inserting the data.

But what you cannot do is copy/paste or something like that.

What I'd tell you to do in Word is to insert/embed a spreadsheet object and
manipulate that. I think Powerpoint has an equivalent, but I'm not familiar
with the exact syntax. You'll get the fastest help on that in the powerpoint
newsgroup. Steve and Shyam occasionally pass through here, if they aren't busy
otherwise. But you're more likely to get their attention in the powerpoint
group :)
Is there a way in code to copy data out of an Excel file even if Excel is
not up and running? If Excel were open, I'd copy, say, the first 30 rows
and paste the info to PowerPoint. Then, since rows 1-5 are for column
headings, I'd hide rows 6-30 and copy a new range which would look involve
30 rows, but since rows 6-30 were hidden would be 1-5 and then 31-55, making
the selection appear as a
contiguous block.

I am trying to do this in VBA without opening Excel and instatiating
objects, etc. Is it possible? What VBA commands would I use?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

Colleyville Alan

Cindy M -WordMVP- said:
Hi Colleyville,

You can access the data in an Excel file without opening it using ADO (ActiveX
Data Objects) or the JET engine (DAO). Then you'd have to automate building
the table in Powerpoint and inserting the data.

But what you cannot do is copy/paste or something like that.


Unfortunately, I already have the data. I am writing it from Access to an
ActiveX spreadsheet in a form and saving a copy to Excel as well. I could
open Excel, but I am trying to avoid that. I have tried the MS Office
Spreadsheet component (Web Components) spreadsheet, but it lacks wordwrap
and lacks the copypicture method. I have tried Formula One's spreadsheet,
and it does have wordwrap, but not copypicture. All I want is a spreadsheet
ActiveX with formatting and copypicture (I don't need any functions, not
even SUM!). Alas, my search continues.

If I have to, I can open the saved Excel sheet to do the copypicture stuff,
but it would be a pain. The solution is already somewhat inelegant.

Thanks for the info.
Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top