By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

how to resolve a problem in excel when it opens

chandru8
100+
P: 145
Hi to all

I had a problem in excel file..,

I am generating a new excel file through vb6.0 and i can access data from that excel.

if user opens another excel file and closes my excel file also closed how to resolve this problem.

can any one help me on this

thank you for all in advance.
May 23 '08 #1
Share this Question
Share on Google+
3 Replies


kadghar
Expert 100+
P: 1,295
Hi to all

I had a problem in excel file..,

I am generating a new excel file through vb6.0 and i can access data from that excel.

if user opens another excel file and closes my excel file also closed how to resolve this problem.

can any one help me on this

thank you for all in advance.
open your excel file in a new object (excel application) and set its visible=false. this way, user wont be able to close it.
May 26 '08 #2

P: 57
open your excel file in a new object (excel application) and set its visible=false. this way, user wont be able to close it.

Hi,

We have to use API function when we handle multiple instance of excel application. If you don't have any idea about this I will post code.


musai.
Jun 3 '08 #3

kadghar
Expert 100+
P: 1,295
Hi,

We have to use API function when we handle multiple instance of excel application. If you don't have any idea about this I will post code.


musai.
Dear sir,

As long as i understood chandru's question, he should be using something like this to open an Excel's instance, and using its data:

Expand|Select|Wrap|Line Numbers
  1. dim Obj1 as object
  2. set obj1 = createobject("excel.application")
  3. obj1.visible = true 
  4. obj1.workbooks.open ("c:\myBook.xls")
  5. msgbox obj1.cells(1,1)
(that might have something to do with API's)

But chandru's problem (as i understood it) is that this new excel's instance (obj1) can be used during runtime by the user (since its visible). So if the user closes this Excel's Application instance. Any further code that references Obj1 will cause an error. The easier solution i can think of, is leaving this instance invisible for the user, so he'she cannot close it that easily.

But then again, sometimes i missunderstand the questions, and give solutions that have nothing to do with the subject.

Kad
Jun 3 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.