• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

starting a process in vb.net

Hi,

In  my program,  I have declared a process and using it to open an excel file as follows:

 proc = Process.Start("C:/myfile.xltm")

On my VB.net form, I have  a panel and using it as a container to host my excel  application. It works fine when no other excel file is open.
But when some other excel file is already open on my computer, and I try to open myfile.xltm on a button click,  myfile.xltm opens in the excel application instead of opening in a panel on vb.net form.

Is there a way to make it mandatory for the process to open the file in Panel only instead of using the open excel application to open this file?

I hope this makes sense.....

Any help will be highly appreciated....
0
Tina_Bhole
Asked:
Tina_Bhole
  • 3
  • 3
1 Solution
 
CodeCruiserCommented:
Excel uses a single window to host the open files so I don't think you can change it unless you host the already open excel instance in your panel.
0
 
Tina_BholeAuthor Commented:
Hi CodeCruiser,

Thanks for your response. But I still believe there must be some way of doing this because my boss said that he can open excel workbooks in sepereate windows but he is not sure what settings are required for this as some one else built the computer for him.
I found some posts on the internet , but they didn't work for me, so still trying to figure out how it can be done in Windows XP, vista and Windows 7
0
 
CodeCruiserCommented:
Have you seen your boss opening multiple windows of excel?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Tina_BholeAuthor Commented:
Hi CodeCruiser,

Yes, he showed me how he did it and even I could achieve it. Please see the screen shot.

 proc = Process.Start("excel.exe", "filename") worked for me

So, instead of opening a filename in a process, now I am opening excel.exe and supplying filename as an argument
Excel-in-seperate-windows.PNG
0
 
CodeCruiserCommented:
Yes that should work. When you just use file name in process.start, the currently running instance of excel catches that and opens the file. if you explicitly start another instance of excel then it would.
0
 
Tina_BholeAuthor Commented:
proc = Process.Start("excel.exe", "filename") worked for me
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now