tradinfo
asked on
Urgent! How to add rows or columns in Excel via OLE automation???
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...
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...
ASKER
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++ ???
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++ ???
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(lpDis p);
range.Insert(xlShiftToRigh t);
LPDISPATCH lpDisp;
Range range;
lpDisp = sheet.GetRange(COleVariant
ASSERT(lpDisp);
range.AttachDispatch(lpDis
range.Insert(xlShiftToRigh
ASKER
Where could I find all the constants used in Excel, like xlVAlign, xlShiftToRight, etc...
Do you know a document which enumerates all these constants?
Do you know a document which enumerates all these constants?
ASKER
I have found myself the answer.
ASKER
This question has a deletion request Pending
This question no longer is pending deletion
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you.
ASKER
You're welcome.
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