Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2000-04-18
10
Medium Priority
?
311 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

718 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