ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to GetText() from TextBox under Visual C++ application? (https://www.excelbanter.com/excel-worksheet-functions/156600-how-gettext-textbox-under-visual-c-application.html)

Danil

How to GetText() from TextBox under Visual C++ application?
 
This code in VB works:

Dim ws As Worksheet
....
Dim myText As OLEObject
Set myText = ws.OLEObjects("TextBox1")
str = myText.Object.Text

The same in Visual C++ does not (error DISP_E_MEMBERNOTFOUND):

_Worksheet objSheet;
....
TextBox myText;
myText = objSheet.OLEObjects(COleVariant(_T("TextBox1")));
CString str = myText.GetText();

What is an analog in Visual C++ of ".Object" property?


All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com