LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to make sure the file is saved on a network

Hi,
I have created an excel addin which adds a toolbar after help menu bar.
It opens querydatabase.xls in the same directory where addin exists in
readonly mode and allows you to add, edit, save records.
The file is not shared and saved with a open and readonly password
every time it saves. due to the password nobody opens the file in their
excel window and the addin is used by 15+ staff at a time.
whenever a user wants to add a record or edit record he is given a
userform to add record/ edit record. (the file is opened in the
background in readonly mode and window is hidden to retrieve the
original record to edit the record)

when the usr presses save, the file is opened in exclusive mode and
changes are saved by going to correct row by seeking the correct record
in edit by match function on primary key and if new record then the
last row by xlup

the problem is if 2 staff press save at the same time then excel
sometimes create a file with hex name like A00H080 without extension
(doesnt goto err handler if fails to save with exact name). i dont know
why this happens and how can i make sure that the record is saved or
not.

the line for opening in the background is as follows
workbooks(querydb).open querydbfullpath ,,:true (readonly),readPWD

when saving
workbooks.open querydbfullpath ,,opnPWD,readPWD
if workbooks(querydb).readonly)
msgbox "file is locked by somebody cant save now try after 10
seconds" : exitsub........
endif
change or add a record
workbooks(querydb).saveas workbooks(querydb).fullpath
,,opnPWD,readPWD,exclusive... etc.
workbooks.open querydbfullpath, readonly

but it doesnt return any err msg if the file is not saved. (document
not saved)

I have made sure that the file opened is not in readonly mode after it
is opened with workbooks(querydb).readonly flag.
So if a file is opened in exclusive mode and there is plenty of place
on server and saved immediately why the record isn't saved sometime?

it was working intially ok when file size was below 400k but now gives
a bit problem.


---
Message posted from http://www.ExcelForum.com/

 
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
Excel file corrupted when saved or retrieved over network Tradesman Excel Discussion (Misc queries) 2 September 15th 08 01:11 PM
excel 2003 file converted to .xlsm file when save to network drive Chris Excel Discussion (Misc queries) 3 January 23rd 08 02:56 PM
Adding a field to an excel sheet saved in a network shared folder Marwan Kandeel Excel Discussion (Misc queries) 0 August 21st 06 02:10 PM
Files being saved to local computer instead of network server? drvmark Excel Discussion (Misc queries) 1 June 14th 06 10:14 PM
network save msg overwrite or make copy Bill Stenzel Excel Discussion (Misc queries) 0 July 28th 05 06:44 PM


All times are GMT +1. The time now is 01:19 AM.

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"