Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Append to open CSV

I currently have my equipment software send information to
a CSV file. It will continue to append to the CSV for as
long as I wish. I would like to have the file open in
Excel while appending to the CSV file so that I can see
the results of each measurement in real time.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Append to open CSV


"CY459" wrote in message
...
I currently have my equipment software send information to
a CSV file. It will continue to append to the CSV for as
long as I wish. I would like to have the file open in
Excel while appending to the CSV file so that I can see
the results of each measurement in real time.


I have never actually done this, but hopefully someone with more experience
will correct my mistakes, and it's a few hours since you posted without any
response.

You can open a file in VBA with shared access. You probably also need to
make sure that your logging software also allows a file share on the file.

This is what the VBA help file says:


Enables input/output (I/O) to a file.

Syntax

Open pathname For mode [Access access] [lock] As [#]filenumber
[Len=reclength]

The Open statement syntax has these parts:

Part Description
pathname Required. String expression that specifies a file namežmay include
directory or folder, and drive.
mode Required. Keyword specifying the file mode: Append, Binary, Input,
Output, or Random. If unspecified, the file is opened for Random access.
access Optional. Keyword specifying the operations permitted on the open
file: Read, Write, or Read Write.
lock Optional. Keyword specifying the operations permitted on the open file
by other processes: Shared, Lock Read, Lock Write, and Lock Read Write.
filenumber Required. A valid file number in the range 1 to 511, inclusive.
Use the FreeFile function to obtain the next available file number.
reclength Optional. Number less than or equal to 32,767 (bytes). For files
opened for random access, this value is the record length. For sequential
files, this value is the number of characters buffered.
Remarks

You must open a file before any I/O operation can be performed on it. Open
allocates a buffer for I/O to the file and determines the mode of access to
use with the buffer.
If the file specified by pathname doesn't exist, it is created when a file
is opened for Append, Binary, Output, or Random modes.
If the file is already opened by another process and the specified type of
access is not allowed, the Open operation fails and an error occurs.

The Len clause is ignored if mode is Binary.

Important In Binary, Input, and Random modes, you can open a file using a
different file number without first closing the file. In Append and Output
modes, you must close a file before opening it with a different file number.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Append query Deltic New Users to Excel 1 August 15th 08 09:16 PM
How do you append one row to another? BobVanS Excel Worksheet Functions 3 August 30th 07 02:04 PM
Append text Jeff Excel Discussion (Misc queries) 1 February 16th 07 10:28 PM
Append worksheets together in one bioyyy Excel Discussion (Misc queries) 1 October 14th 05 07:10 AM
open for append Marcel Jahn Excel Programming 1 July 22nd 03 10:15 PM


All times are GMT +1. The time now is 02:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Š2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"