Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Excel renaming file to a temp and deletes original (long)

We have a journal entry log spreadsheet that users go in
to log their transactions. The logging process is done
automatically through VBA. It usually opens the workbook,
logs the entry, saves, and closes the workbook pretty fast
(2 secs). Most of the time it isn't a problem. A problem
will occur if a user accesses the log while it is being
saved by another user. This will create a temp file and
delete the original file. It's probably not related to
virus software or permission. It's probably caused by the
interruption during the saving process. You would think
that throughout the day users wouldn't run into each other
with the 2 secs it takes to open and close the log.
However, it does happen. I am wondering if I can lock the
file until a user is finish with it. I did code some
logic to it that if the file is read-only then close the
file, but apparently that still interrupts the process.
Must be the initial opening of the file that messes things
up. I may have to test if the file is read-only using
another way instead of the workbooks.open property. The
only other option I see is to use an Access database to
log the entries. Any help will be appreciated. Thanks...

John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Excel renaming file to a temp and deletes original (long)

John,

I use plain text files as logs. If that's possible for you, then check
the 'Open statement' in VBE help. Look at the 'lock' parameter.

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------


We have a journal entry log spreadsheet that users go in
to log their transactions. The logging process is done
automatically through VBA. It usually opens the workbook,
logs the entry, saves, and closes the workbook pretty fast
(2 secs). Most of the time it isn't a problem. A problem
will occur if a user accesses the log while it is being
saved by another user. This will create a temp file and
delete the original file. It's probably not related to
virus software or permission. It's probably caused by the
interruption during the saving process. You would think
that throughout the day users wouldn't run into each other
with the 2 secs it takes to open and close the log.
However, it does happen. I am wondering if I can lock the
file until a user is finish with it. I did code some
logic to it that if the file is read-only then close the
file, but apparently that still interrupts the process.
Must be the initial opening of the file that messes things
up. I may have to test if the file is read-only using
another way instead of the workbooks.open property. The
only other option I see is to use an Access database to
log the entries. Any help will be appreciated. Thanks...

John


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
Why is my excel spreadsheet now a temp file? Brew Excel Discussion (Misc queries) 0 May 19th 10 12:54 PM
Excel File saved as Temp file DennisM New Users to Excel 1 January 7th 10 04:56 PM
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Renaming sheets with part of original name MichaelR Excel Worksheet Functions 1 June 5th 08 05:30 AM
Renaming and saving workbooks but macro still deletes shrek Excel Worksheet Functions 0 November 8th 05 05:43 PM


All times are GMT +1. The time now is 12:54 PM.

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

About Us

"It's about Microsoft Excel"