Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2000-04-18
10
Medium Priority
?
317 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
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.

 

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 136 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

885 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