Click here to Skip to main content
15,906,816 members
Home / Discussions / COM
   

COM

 
QuestionAppCrash Issue related to COM? Pin
Tony Tullemans24-Jan-13 13:17
Tony Tullemans24-Jan-13 13:17 
AnswerRe: AppCrash Issue related to COM? Pin
Richard MacCutchan24-Jan-13 23:01
mveRichard MacCutchan24-Jan-13 23:01 
GeneralRe: AppCrash Issue related to COM? Pin
Tony Tullemans28-Jan-13 11:28
Tony Tullemans28-Jan-13 11:28 
GeneralRe: AppCrash Issue related to COM? Pin
Richard MacCutchan28-Jan-13 22:32
mveRichard MacCutchan28-Jan-13 22:32 
AnswerRe: AppCrash Issue related to COM? Pin
Stephen Hewitt27-Jan-13 14:13
Stephen Hewitt27-Jan-13 14:13 
Questionuse webbrowser to visit many webs without a break cause crash Pin
BCN-16321-Jan-13 14:52
BCN-16321-Jan-13 14:52 
QuestionHow to register a com exe without admin rights? Pin
Hari-Adarapu11-Jan-13 9:37
Hari-Adarapu11-Jan-13 9:37 
AnswerRe: How to register a com exe without admin rights? Pin
Richard MacCutchan12-Jan-13 0:10
mveRichard MacCutchan12-Jan-13 0:10 
GeneralRe: How to register a com exe without admin rights? Pin
Marius Bancila23-Jan-13 10:37
professionalMarius Bancila23-Jan-13 10:37 
GeneralRe: How to register a com exe without admin rights? Pin
Richard MacCutchan23-Jan-13 22:48
mveRichard MacCutchan23-Jan-13 22:48 
GeneralRe: How to register a com exe without admin rights? Pin
Marius Bancila24-Jan-13 3:07
professionalMarius Bancila24-Jan-13 3:07 
QuestionWhat type of permissions are needed to resolve Acccess denied for GetDsOfNames to registry entry HKCR\Typelib Pin
ForNow7-Jan-13 11:41
ForNow7-Jan-13 11:41 
AnswerRe: What type of permissions are needed to resolve Acccess denied for GetDsOfNames to registry entry HKCR\Typelib Pin
Richard MacCutchan7-Jan-13 22:20
mveRichard MacCutchan7-Jan-13 22:20 
QuestionCreating .OCX file hangs Pin
ForNow1-Jan-13 17:44
ForNow1-Jan-13 17:44 
QuestionGetIDsOfNames returning -1 Pin
ForNow27-Dec-12 12:28
ForNow27-Dec-12 12:28 
AnswerRe: GetIDsOfNames returning -1 Pin
Richard MacCutchan27-Dec-12 21:48
mveRichard MacCutchan27-Dec-12 21:48 
QuestionMixing native OLE with MFC interface/wrappers Pin
ForNow26-Dec-12 15:30
ForNow26-Dec-12 15:30 
AnswerRe: Mixing native OLE with MFC interface/wrappers Pin
DriveByCoder24-Mar-15 7:41
professionalDriveByCoder24-Mar-15 7:41 
Question_WorkSheet::Paste usage Pin
ForNow19-Dec-12 13:01
ForNow19-Dec-12 13:01 
Hi,

I am trying to paste a .txt file onto
an Excel spreadsheet

Off hand it seemed to me the logical
method would be _WorkSheet::Paste

I have done countless google searches
and have yet to come up with C++
exampe of how this method is used

This is the prototype of the method in Excel.h
C++
void Paste(const VARIANT& Destination, const VARIANT& Link);


When I did research on the data type VARIANT the documentation said its a union for many data types

One of them being a LDISPATCH type

The code below is a snipet of the code I have been stuggling with to get the _WorkSheet::Paste method
to work

My logic was to get a LDISPATCH pointer to the range off cells I was trying to paste onto

However I keep on running into exceptions

If anyone could shead some light on this I would be very gratefull

thanks in advance
C++
CI46023App theApp;       // Main CwinThread
_Application app;        // excel application object
_Workbook objBook;       // workbook object 
Workbooks objBooks;      // ditto
Worksheets objSheets;    // worksheet object
_Worksheet objSheet;     // worksheet
LPDISPATCH myrangeptr; 





app.CreateDispatch("Excel.Application");
  objBooks = app.GetWorkbooks();
  objBook = objBooks.Add(VOptional);
  objSheets = objBook.GetWorksheets();
  objSheet = objSheets.GetItem(COleVariant((short)1));
  myrangeptr = objSheet.GetRange(COleVariant(TEXT("A1")),COleVariant(TEXT("M34")));
  objSheet.Paste((VARIANT &)myrangeptr, COleVariant((short)TRUE));

AnswerRe: _WorkSheet::Paste usage Pin
Jochen Arndt19-Dec-12 21:45
professionalJochen Arndt19-Dec-12 21:45 
GeneralRe: _WorkSheet::Paste usage Pin
ForNow20-Dec-12 5:21
ForNow20-Dec-12 5:21 
GeneralRe: _WorkSheet::Paste usage Pin
Jochen Arndt20-Dec-12 21:04
professionalJochen Arndt20-Dec-12 21:04 
QuestionMSDN documentation for MFC OLE wrapper method/prperties Pin
ForNow17-Dec-12 13:10
ForNow17-Dec-12 13:10 
AnswerRe: MSDN documentation for MFC OLE wrapper method/prperties Pin
Richard MacCutchan17-Dec-12 22:19
mveRichard MacCutchan17-Dec-12 22:19 
GeneralRe: MSDN documentation for MFC OLE wrapper method/prperties Pin
ForNow18-Dec-12 2:28
ForNow18-Dec-12 2:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.