Solved

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

Posted on 2000-04-18
10
300 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

679 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