Solved

Urgent! How to add rows or columns in Excel via OLE automation???

Posted on 2000-04-18
10
306 Views
Last Modified: 2012-06-21
Hi,
I hope someone know how I could add empty rows or columns in Excel via OLE Automation (using MsVC++5) ???
Thanks in advance!
P.S: I know how OLE automation works, but i am unable to find the answer to this question...
0
Comment
Question by:tradinfo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 5

Expert Comment

by:proskig
ID: 2726824
Check this article http://www.codeguru.com/misc/excel_automation.shtml
So if you know how to accomplish your task using VBA - the article will help. If not the easiest way can be to record macro - do what you need (e.g. to add empty cells) and then to use code for recorded macro
0
 

Author Comment

by:tradinfo
ID: 2726863
Sorry, but it does not solve my problem at all.
By adding rows or columns, I mean "INSERTING" rows in an existing worksheet, between 2 existing filled rows...
Do you know the way to insert rows in Excel, via automation with MsVC++ ???
0
 
LVL 1

Expert Comment

by:MT_MU
ID: 2727160
Have you tryed the Insert Method for a range object...as in...

LPDISPATCH lpDisp;
Range range;  
lpDisp = sheet.GetRange(COleVariant(cell), COleVariant(cell));
ASSERT(lpDisp);
range.AttachDispatch(lpDisp);
range.Insert(xlShiftToRight);
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tradinfo
ID: 2729632
Where could I find all the constants used in Excel, like xlVAlign, xlShiftToRight, etc...
Do you know a document which enumerates all these constants?
0
 

Author Comment

by:tradinfo
ID: 2730374
I have found myself the answer.
0
 

Author Comment

by:tradinfo
ID: 2730375
This question has a deletion request Pending
0
 
LVL 1

Expert Comment

by:MT_MU
ID: 2730542
This question no longer is pending deletion
0
 
LVL 1

Accepted Solution

by:
MT_MU earned 34 total points
ID: 2730543
Your original question was answered.

You should award the points.
0
 
LVL 1

Expert Comment

by:MT_MU
ID: 2730920
Thank you.
0
 

Author Comment

by:tradinfo
ID: 2731180
You're welcome.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question