Link to home
Start Free TrialLog in
Avatar of Tina_Bhole
Tina_Bhole

asked on

Embedding Excel (Macro enabled) file in windows form in VB.net

Hi,

I have a macro enabled Excel file, saved on my c drive as mytemp.xltm

My question is, how do I open the file in windows form in vb.net at run time?
Or is there a way to add this excel template to windows form at design time?

So, basically, I am looking at embedding this file into vb.net form in read/write mode.


Thanks in advance
Avatar of Rinil
Rinil
Flag of India image

hi,

Below link may help with a sample example showing how to open a excel in vb.net

http://www.daniweb.com/software-development/vbnet/threads/332821/run-excel-macros-with-vb.net#

For more detailed view, have a look in below

http://msdn.microsoft.com/en-us/library/office/ff194819.aspx

hope this helps
Avatar of Nasir Razzaq
Avatar of Tina_Bhole
Tina_Bhole

ASKER

Hi all,

Thanks for replying.
But unfortunately, none of these is helping me with what I want to acheive. I actually want to open excel work sheet in read and write mode within the application, not seperately.
Codecruiser, I tried your code but could not figure out how to make it work with excel. For some reason it kept on opening browser in a new window but could not recognise excel as an applicaiton process
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks heaps CodeCruiser. Thats exactly what I was looking for.
you have been able to do it with Excel?

On my machine (Windows 8, Office 2013), Notepad opens correctly inside the panel but Excel opens a standalone instance!
I am now able to host Excel into a form but now the menus are not visible!