Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / April 2006

Tip: Looking for answers? Try searching our database.

Call VBA-function from net and get the result

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bruno Uato - 08 Apr 2006 22:54 GMT
Hello,

how can I call from a net solution a vba-function and get the result.

For example

Dim Result as string

Result = vbafunction(......

Thanks in advance, Bruno
Helmut Obertanner - 09 Apr 2006 13:38 GMT
Hello Bruno,

here is a sample how I'm adding a .dot file to word and call a VBA macro in
it.
Maybe you find it usefull.

// our word AddIn
Word.AddIn addIn = wordApp.AddIns.Add( "C:\\X4UTools.dot", ref _Missing);

// call our Macro to set the button image
Type wordType = wordApp.GetType();
object[] args = { "UpdateToolBar", "XConnect", "XMail", assemblyPath +
"X4UButtonPicture.bmp", assemblyPath + "X4UButtonMask.bmp" };

wordType.InvokeMember("Run", BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.InvokeMethod, null, wordApp, args);    

// Remove Addin
addIn.Delete();

// Cleanup
if (wordApp != null) Marshal.ReleaseComObject(wordApp);

This should be a starting point.

Hope this helps,
Signature

Helmut Obertanner
MVP - Visual Developer VSTO

http://www.x4u.de

> Hello,
>
[quoted text clipped - 7 lines]
>
> Thanks in advance, Bruno

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.