help hiding excel application

T

teejayem

I am using Visual Basics.NET to read data from an Excel file.
I am using the following code

Dim xlApp as Excel.Application
Dim xlBook as Excel._Worksheet

xlApp = CreateObject(Excel.Application)
xlBook = xlApp.WorkBooks.Open("path of Excel file")

------------------------------

This works fine but my problem is that if i open another Excel
document whilst my program is running the Excel document the program
has opened becomes visible to the user. If they then close Excel down
this closes down the document my program is using and causes errors.

Is there any way of stopping this?

Any help is much appreciated.

Kind Regards,

Tom Miller.
 
N

NickHK

What do you mean by "That didn't work" ?
If the user double-clicks on an Excel file, your instance of Excel will not
respond to the DDE request.
Assuming your instance is not visible, how is the user interacting with it ?

NickHK
 
T

teejayem

What do you mean by "That didn't work" ?
If the user double-clicks on an Excel file, your instance of Excel will not
respond to the DDE request.
Assuming your instance is not visible, how is the user interacting with it ?

NickHK







- Show quoted text -

When the app is loaded it populates textboxes on my main form with
data from the Excel file.
At this point the excel file is not visible
if a user then opens a different document in Excel by clicking on the
document in Explorer it loads the excel file and also displays the
file that is being used by my application.
I don't want the excel file that is being used by my application to be
visible to users.
They then have to keep excel open. If they close Excel the file is
closed down leaving my application unusable because the file has been
closed by the user which i don't want to be possible.

Hope this makes more sense.

Tom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top