[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

starting a process in vb.net

Posted on 2012-09-02
6
Medium Priority
?
506 Views
Last Modified: 2012-09-22
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
Comment
Question by:Tina_Bhole
  • 3
  • 3
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38360194
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
 

Author Comment

by:Tina_Bhole
ID: 38374461
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38388700
Have you seen your boss opening multiple windows of excel?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Accepted Solution

by:
Tina_Bhole earned 0 total points
ID: 38389850
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38390233
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
 

Author Closing Comment

by:Tina_Bhole
ID: 38424400
proc = Process.Start("excel.exe", "filename") worked for me
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question