#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Saving file

I distribute a file to users on the network, they enter information and then
save it back to the network. The problem is that the network is slow, so
sometimes users will save it to their C drive to work on it, and then forget
to switch back to the network when they are done. I added code to save back
to the network when they complete their processing; however, it states that
the file cannot be accessed when they are working directly off the network. I
need code that saves as to the network when working off the c drive and just
saves when working off the network.

This is what I currently have:

Application.DisplayAlerts = False
dim netwrkpath5 as string
dim branch as string
branch = Sheets("RegionalOutputFile").Range("aa2").Value

netwrkpath5 = "\\ahfctor01\ahfcsharedfiles\Branch and Corporate\BR" + branch
netwrkpath5 = netwrkpath5 + "\Region" + branch + "BARModel.xls"
ActiveWorkbook.SaveAs Filename:=netwrkpath5
Application.DisplayAlerts = True


Thanks for any help you can give!

--
Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving file


this should work enter it into the thisworkbook module

Code
-------------------

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Left(ThisWorkBook.Path, 1) = "c" Then ' so if it is on there drive
MsgBox "hello" ' enter you code here
End If

'it will still save as they clicked save

End Sub

-------------------


this will do as you asked, although it will not overcome your proble
if more than one person is entering info into each workbook, and i
isnt shared

person (A) opens the workbook and saves it to their own hard drive
person (B) opens the workbook and save it to their own hard drive
person (A) saves his workbook back on to the network
person (B) saves his workbook back on to the network (overwritin
person (A)'s info)

(not sure if that is the case, if it is)

How many people are using the workbook?
How often is it used?
How large is the workbook?
Do the users need to see each others information

--
irishboy
-----------------------------------------------------------------------
irishboyx's Profile: http://www.excelforum.com/member.php...fo&userid=3249
View this thread: http://www.excelforum.com/showthread.php?threadid=52289

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Saving file

I think that will work, if the path is C is will use Save and if it is
something else I will use SaveAs. Only one user has access to each workbook.

Thanks!

Paul

--
Paul


"irishboyx" wrote:


this should work enter it into the thisworkbook module

Code:
--------------------

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Left(ThisWorkBook.Path, 1) = "c" Then ' so if it is on there drive
MsgBox "hello" ' enter you code here
End If

'it will still save as they clicked save

End Sub

--------------------


this will do as you asked, although it will not overcome your problem
if more than one person is entering info into each workbook, and it
isnt shared

person (A) opens the workbook and saves it to their own hard drive
person (B) opens the workbook and save it to their own hard drive
person (A) saves his workbook back on to the network
person (B) saves his workbook back on to the network (overwriting
person (A)'s info)

(not sure if that is the case, if it is)

How many people are using the workbook?
How often is it used?
How large is the workbook?
Do the users need to see each others information?


--
irishboyx
------------------------------------------------------------------------
irishboyx's Profile: http://www.excelforum.com/member.php...o&userid=32498
View this thread: http://www.excelforum.com/showthread...hreadid=522893


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
Saving Excel 2007 file in 2003 creates very large file Jon Pearce Excel Discussion (Misc queries) 2 July 16th 09 07:20 PM
Confused here Prevent Saving File - but allow ONLY File SAVEAS Met JMay Excel Discussion (Misc queries) 2 June 17th 07 04:37 PM
Saving multi-tab excel file created from comma delimited text file Marcus Aurelius Excel Programming 2 December 19th 05 05:16 PM
How do I stop Excel 2000 from saving file history from file that . Cathy Excel Discussion (Misc queries) 0 March 29th 05 03:27 PM
saving an excel file as an ASCII text file without delimiters Sewellst Excel Programming 4 January 7th 05 01:41 PM


All times are GMT +1. The time now is 07:22 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"