Solved

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

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

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now