473,614 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
2 1804
> 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******** *************** ***********@mic rosoft.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
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******** *************** ***********@mic rosoft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13461
by: Martin | last post by:
There is an Access table on the network. 15 users who do not have Access are connected to the network. Is there a way for each user to be able to enter one or more rows containing 3 or 4 columns to Excel on his machine and then press a button or something and append that data to the Access table on the network? Any suggestions on what the code would be? Thank you very much! Martin
8
8080
by: Colleyville Alan | last post by:
I have been working on an Access app that takes info from a file and writes it to a spreadsheet on a form, simultaneously saving the spreadsheet to Excel. I got the idea that the same concept could work in reverse, i.e. we have a cost model written in Excel that calculates the profitability of customer accounts based on several inputs and they need to be updated at least once per year. These cost models sit on lots of people's hard...
6
12486
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C# application. It seems simple enough, but the problem I'm encountering is as follows: In order for the user to select the cell from Excel, they must first click once on the Excel window to give it focus and then their second click is what changes the cell...
9
3375
by: Brian Hanson | last post by:
Hi, I have an unusual problem that just showed its ugly head at a pretty bad time. I have an asp.net (VB) app that takes data from an Excel sheet and puts it into SQL Server. I get the data out of Excel using OleDB, and suddenly, some of the data was not being extracted from Excel. I use OleDb for the extract into a DataTable and from there an SqlClient.SqlCommand to put it into SQL Server.
1
15867
by: Brian Conklin | last post by:
Hello Eneryone, I am having a problem. I have written a little app that will take a text "pipe" delimited file and place all of the values in to an Excel spreadsheet. It works great on any of my XP Pro machines. When I install the app on a Win2K Pro machine, I get the following error message: ************** Exception Text ************** System.Runtime.InteropServices.COMException (0x80020008): Bad variable type. at...
10
1659
by: Doug Bell | last post by:
Hi, I have an application that has a "Data Access Class" and "User Interface Class". It is for receiving Purchase Order data from one system and pushing processed transactions to another system. The system generally works quite well. Currently the User interface calls for a refresh of data every 15 minutes (selectable) and the Data Access Class connects to the DB and retrieves the
30
3381
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on the dataset or connection? TIA
7
28886
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can actually do something more with. This code shows you how to display data from your database and then how to give that data to the user in the form of a useable Excel spreadsheet which they can then take away and play with themselves. The way I have shown...
7
13161
by: kpresidente | last post by:
Hello all, I'm trying to transfer the value of a control on an Access form to an Excel worksheet using VBA. The Access form is a single form with all the controls disabled, so that data is "read only." I have a button on the form which opens the Excel worksheet, which then basically serves as the input form for the Access database. What I need is to somehow get the primary key (EstimateID) of the current record on the Access form...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8433
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.