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

Data not going into Excel from Form button - Do I need a thread

P: n/a
JM
Hi

I have created a Windows Form that takes input. When the Run button is
pressed the form is disabled and the code checks some files and inputs the
data into an Excel worksheet (that is hidden so that I cannot watch as it
gets filled up). When it is done it saves the Excel file.

I find that if I go into another program while it's trying to work on the
Excel spreadsheet that not all of the data appears (missing data!). If I
click the Run button and then do nothing (don't touch the keyboard) all of
the data appears in the spreadsheet no problem.

What the heck am I missing??? I don't have the Minimize and Maximize
buttons on the Windows Form but that should not make a difference right? Do
I need to make a thread or something?
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> I find that if I go into another program while it's trying to work on the
Excel spreadsheet that not all of the data appears (missing data!). If I
click the Run button and then do nothing (don't touch the keyboard) all of
the data appears in the spreadsheet no problem.
Are you using another program to access the Excel spreadsheet as your
program is writing information to it? If this is the case there is probably
a lock on the file by one of the applications; most likely your app is not
locking the file and when Excel opens it will lock it and no further data
can be written to it your program should error out. Is your program
crashing or reporting any errors?

"JM" <JM@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com... Hi

I have created a Windows Form that takes input. When the Run button is
pressed the form is disabled and the code checks some files and inputs the
data into an Excel worksheet (that is hidden so that I cannot watch as it
gets filled up). When it is done it saves the Excel file.

I find that if I go into another program while it's trying to work on the
Excel spreadsheet that not all of the data appears (missing data!). If I
click the Run button and then do nothing (don't touch the keyboard) all of
the data appears in the spreadsheet no problem.

What the heck am I missing??? I don't have the Minimize and Maximize
buttons on the Windows Form but that should not make a difference right?
Do
I need to make a thread or something?

Nov 17 '05 #2

P: n/a
JM
If I don't touch the computer while it is processing it works fine. Once I
start to work with other programs it starts to drop the data from Excel. No
Errors or anything. I just think that when I do other work on the computer
the Excel workbook no longer has the focus.

"Alex Passos" wrote:
I find that if I go into another program while it's trying to work on the
Excel spreadsheet that not all of the data appears (missing data!). If I
click the Run button and then do nothing (don't touch the keyboard) all of
the data appears in the spreadsheet no problem.


Are you using another program to access the Excel spreadsheet as your
program is writing information to it? If this is the case there is probably
a lock on the file by one of the applications; most likely your app is not
locking the file and when Excel opens it will lock it and no further data
can be written to it your program should error out. Is your program
crashing or reporting any errors?

"JM" <JM@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
Hi

I have created a Windows Form that takes input. When the Run button is
pressed the form is disabled and the code checks some files and inputs the
data into an Excel worksheet (that is hidden so that I cannot watch as it
gets filled up). When it is done it saves the Excel file.

I find that if I go into another program while it's trying to work on the
Excel spreadsheet that not all of the data appears (missing data!). If I
click the Run button and then do nothing (don't touch the keyboard) all of
the data appears in the spreadsheet no problem.

What the heck am I missing??? I don't have the Minimize and Maximize
buttons on the Windows Form but that should not make a difference right?
Do
I need to make a thread or something?


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.