ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with Excel using a .Net rich text box (https://www.excelbanter.com/excel-programming/304161-problem-excel-using-net-rich-text-box.html)

Esteban404

Problem with Excel using a .Net rich text box
 
The scenario indicates everything works fine from within
an IDE or other programmed environment making a call to
Excel, but fails when Excel is responsible for the
execution. I don't have anything specific, but... I've
done some of these and there is a trust issue that
complicates development where Excel does execution from a
macro. It may be tied to that. Assuming you want a non-
specific instance created, I can't think of a work around
off the top of my head. Hope this is a direction you can
use...

E.

-----Original Message-----
Hello,

I have a feeling that this one is going to be difficult

to solve but here it
goes:

I have a form in built in a .Net DLL that uses the Rich

Text Box from the
1.1 framework. When I run the form from a .Net

application there are no
problems. When I run the form from a VB6 application

there are no problems.

However, if I run the from from an Excel macro, I get a

strange problem
where the property for "SelectedFont" is always null no

matter what you set
the font to (not just in situations where the selected

text contains
multiple fonts).

I have attached a sample VS.Net solution to demonstrate

the problem. If you
set the startup project to the WinApp program and run it,

it will work
properly. If you set the startup project to the RTBTest

DLL and set the
project to launch the program "VB WinApp.exe" included

with that project it
will run properly (press the button on the form to bring

up the .Net form
with the RTB).

If you set the startup project to the RTBTest DLL and set

the project to
launch Excel with a command line argument of the included
"TestWorksheet.xls" it will lauch a workbook that has a

single button on it
to press to get to the .Net form in question. However, on

this form you will
see that the RTB SelectedFont property is always null

regardless of what is
selected.

Can you please tell me why this is and what I can do to

get it to work
properly?

Kind regards,
Bryan






Bryan[_10_]

Problem with Excel using a .Net rich text box
 
thanks E. I'll see what I can find on the issue. I was wondering if it might
be an assembly security issue, maybe I'll explore some things along those
lines.

Unfortunately, since our application is intended to be a commercial level
application and work as an add-in to Excel, I don't know how much we have
control over when it goes out to the client...

Thanks for your help.


"Esteban404" wrote in message
...
The scenario indicates everything works fine from within
an IDE or other programmed environment making a call to
Excel, but fails when Excel is responsible for the
execution. I don't have anything specific, but... I've
done some of these and there is a trust issue that
complicates development where Excel does execution from a
macro. It may be tied to that. Assuming you want a non-
specific instance created, I can't think of a work around
off the top of my head. Hope this is a direction you can
use...

E.

-----Original Message-----
Hello,

I have a feeling that this one is going to be difficult

to solve but here it
goes:

I have a form in built in a .Net DLL that uses the Rich

Text Box from the
1.1 framework. When I run the form from a .Net

application there are no
problems. When I run the form from a VB6 application

there are no problems.

However, if I run the from from an Excel macro, I get a

strange problem
where the property for "SelectedFont" is always null no

matter what you set
the font to (not just in situations where the selected

text contains
multiple fonts).

I have attached a sample VS.Net solution to demonstrate

the problem. If you
set the startup project to the WinApp program and run it,

it will work
properly. If you set the startup project to the RTBTest

DLL and set the
project to launch the program "VB WinApp.exe" included

with that project it
will run properly (press the button on the form to bring

up the .Net form
with the RTB).

If you set the startup project to the RTBTest DLL and set

the project to
launch Excel with a command line argument of the included
"TestWorksheet.xls" it will lauch a workbook that has a

single button on it
to press to get to the .Net form in question. However, on

this form you will
see that the RTB SelectedFont property is always null

regardless of what is
selected.

Can you please tell me why this is and what I can do to

get it to work
properly?

Kind regards,
Bryan









All times are GMT +1. The time now is 06:28 AM.

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