473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VBA & C#

Hi,

Is it possible to integrate VBA within a C# MDI application? If yes, is
there any exemples?

What I am trying to do is let the user of my app add any child windows he
would like to the MDI and customize their layout using VBA...

Any ideas?

Thanks
JPRoot

Nov 15 '05 #1
7 2879
VBA is just a COM script engine, so in theory, it can be done. However, that
means you will end up creating a wrapper for the engine so you C# can host
and talk to it, and furthermore create wrappers for your .NET classes so VBA
(which uses COM) can use them. That's not going to be a happy marriage.

However, you can host the .NET runtime/comilers in your own app, and have
people write C# or VB.NET or J# or JScript code which you can execute at
runtime. Here's a starting place for Visual Studio for Applications
(basically, a .NET version of VBA):
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

-Rob Teixeira [MVP]

"JPRoot" <jp****@hotmail.com> wrote in message
news:OX**************@TK2MSFTNGP09.phx.gbl...
Hi,

Is it possible to integrate VBA within a C# MDI application? If yes, is
there any exemples?

What I am trying to do is let the user of my app add any child windows he
would like to the MDI and customize their layout using VBA...

Any ideas?

Thanks
JPRoot

Nov 15 '05 #2

Hi JPRoot,

Thank you for posting in the community! My name is Jeffrey, and I will be
assisting you on this issue.

Based on my understanding, you write a MDI application using .Net, and you
want to implement the similiar VBA function in you application: that is,
open a code editor and enable the application user to write VBscript code
and execute it runtime.

================================================== ===
Actually, there is Script for the .NET Framework that is the .NET
equivalent of Windows Script. So you can use VSA in you .Net application.
You may try to use the script VSA engine to executive the script code, then
invoke your application's related function for the related script code.
For more information, please refer to the 2 articles below:
http://www.csharphelp.com/archives/archive102.html
http://msdn.microsoft.com/library/de...us/dnclinic/ht
ml/scripting06112001.asp

================================================== ===
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3
Thanks Jeffrey

Where can I get Visual Studio for Applications (VSA) SDK Beta 2

Thank
JPRoo

----- \"Jeffrey Tan[MSFT]\" wrote: ----
Hi JPRoot

Thank you for posting in the community! My name is Jeffrey, and I will be
assisting you on this issue

Based on my understanding, you write a MDI application using .Net, and you
want to implement the similiar VBA function in you application: that is,
open a code editor and enable the application user to write VBscript code
and execute it runtime

================================================== ==
Actually, there is Script for the .NET Framework that is the .NET
equivalent of Windows Script. So you can use VSA in you .Net application
You may try to use the script VSA engine to executive the script code, then
invoke your application's related function for the related script code.
For more information, please refer to the 2 articles below
http://www.csharphelp.com/archives/archive102.htm
http://msdn.microsoft.com/library/de...-us/dnclinic/h
ml/scripting06112001.as

================================================== ==
Please apply my suggestion above and let me know if it helps resolve your
problem

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance

Best regards
Jeffrey Ta
Microsoft Online Partner Suppor
Get Secure! - www.microsoft.com/securit
This posting is provided "as is" with no warranties and confers no rights
Nov 15 '05 #4
AHA!

I just knew this would come up sometime. I tried this earlier in
the vstudio.general newsgroup without any replies (so far).

Original post:

I was initially going to post this in the .vsa group, but there is very
little action there. If it would be better posted elsewhere please
let me know.

I've been looking into this the better part of a day, Googling and
the whole bit, but I can't seem to find a satisfactory answer.
When I "discovered" the vsa classes I got excited, as this looked
like a way to implement scripting from within an application. Alas,
as I attempted to use others' samples, I discovered that this did
not seem to work anywhere near what I had hoped, and not even
close to what I expected. I have added references to:

Microsoft.VisualBasic.Vsa
Microsoft.Vsa

as well as several other libraries that look like they might belong.

I tried something simple at first like this:
class Scripter
{
private IVsaEngine eng;
eng = new VsaEngine();

eng.InitNew();
.....
}

with the correct "using" statments and all. Intellisense is working
for everything up until I type in "eng.", then nothing. So, I tried a
build right quick and keep getting messages about a return value
required for VsaEngine, invalid tokens '(' and '=', just normal
compiler complaints, but they don't make sense in this context.

A lot of this is based on samples from others that I have seen, and
they do the same thing, declare the field as an IVsaEngine, then
assign it a VsaEngine() type, but I'm just stuck here. I've registered
the vsavb7rt.dll, closed and restarted VS, nothing seems to get me
past this point.

Hopefully that will answer most of the obvious questions, I'm just
wondering if there is something else that needs to be done. VSA
appears to be a wonderful thing, if it works. If not, why the hell is
it even there? Or am I just missing a very fundamental thing here?

"JPRoot" <jp****@hotmail.com> wrote in message
news:OX**************@TK2MSFTNGP09.phx.gbl...
Hi,

Is it possible to integrate VBA within a C# MDI application? If yes, is
there any exemples?

What I am trying to do is let the user of my app add any child windows he
would like to the MDI and customize their layout using VBA...

Any ideas?

Thanks
JPRoot

Nov 15 '05 #5

Hi jproot,

Thanks for your feedback.

I will confirm where is the VSA SDK public download link, and I will reply
to you ASAP.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #6

Hi jproot,

It seems that VSA SDK is not public available and is discontinued now.
I am still finding the substitution for VSA, please wait for a little more
time, I will reply to you ASAP.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #7

Hi jproot,

Sorry for letting you wait for so long time.

After contacting product team, it appears that the original VSIP SDK for
VS .Net 2002 contains the VSIP and VSA SDKs. The VSIP program was revamped
with VS .NET 2003, and the VSIP SDK is now publicly available through
www.vsipdev.com.However, it no longer contains the VSA SDK. So VSA SDK was
not publicly available now.

The product team feedback that they are working on the future version of
VSA SDK now.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Collin VanDyck | last post by:
I have a basic understanding of this, so forgive me if I am overly simplistic in my explanation of my problem.. I am trying to get a Java/Xalan transform to pass through a numeric character...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
11
by: Jeremy | last post by:
How can one stop a browser from converting &amp; to & ? We have a textarea in our system wehre a user can type in some html code and have it saved to the database. When the data is retireved...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
7
by: John Nagle | last post by:
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&amp;". Is there some way I can get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.