Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

saving excel file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin - 11 May 2008 06:54 GMT
Hi,
I have some formulas and data which is shared for the users to get their
answers instantly. Is there any way not to allow users to save the excel
shared file if they make any changes. Is it possible if the users close the
file with some changes excel exit without prompting or saving??. i tried read
only, protect sheet etc. its of no use.
Thanks
Kevin
Gary''s Student - 11 May 2008 12:22 GMT
Protect the cells that contain formulas and data that you want protected.  
Even if a user saves the worksheet after making changes, the changes will not
be to protected material.
Signature

Gary''s Student - gsnu200785

> Hi,
> I have some formulas and data which is shared for the users to get their
[quoted text clipped - 4 lines]
> Thanks
> Kevin
Gord Dibben - 11 May 2008 17:08 GMT
Stick these in Thisworkbook module.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
     ThisWorkbook.Saved = True
          ThisWorkbook.Close
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
   Cancel = True
End Sub

To save the workbook with this code you must disable events then save.

Sub disable()
    Application.EnableEvents = False
End Sub

Save workbook at this point.

Re-enable events and no further saving will take place.

Sub enable()
    Application.EnableEvents = True
End Sub

Gord Dibben  MS Excel MVP

>Hi,
>I have some formulas and data which is shared for the users to get their
[quoted text clipped - 4 lines]
>Thanks
>Kevin
Kevin - 12 May 2008 06:30 GMT
Thank u Gord,
The first code is working fine, I am little confused about disabling &
enabling of events. Where to enable this pls help. Thanks in advance.
Kevin.

> Stick these in Thisworkbook module.
>
[quoted text clipped - 31 lines]
> >Thanks
> >Kevin
Gord Dibben - 13 May 2008 01:46 GMT
I don't know how the code is working fine if you did not disable events before
saving after entering the code in Thisworkbook.

How did you save the workbook so's the code is saved?

In order to save the workbook with the code you added to Thisworkbook, you have
to disable events the one time.

The disable and enable Subs would go into a General module.

Run the disable sub then save the workbook.

Run the enable Sub.

Gord

>Thank u Gord,
>The first code is working fine, I am little confused about disabling &
[quoted text clipped - 36 lines]
>> >Thanks
>> >Kevin
Kevin - 13 May 2008 07:32 GMT
Sorry for the late reply Gord, Actually i don't remember wot i did but the
first code is working fine and the excel file exit without saving. i tried
your suggesstion to disable and enabling its also working fine. since i don't
have much knowledge about codes wot i did i just copied your code and saved
it. anyway thanks a lot. i will try to figure out in a new workbook how your
first code is saved and defnitely i will let you know about this.
thanks a lot.
kevin

> I don't know how the code is working fine if you did not disable events before
> saving after entering the code in Thisworkbook.
[quoted text clipped - 52 lines]
> >> >Thanks
> >> >Kevin
Gord Dibben - 13 May 2008 17:16 GMT
Thanks for the feedback.

You must have stumbled onto something I can't figure out but results are what
you wanted.

Gord

>Sorry for the late reply Gord, Actually i don't remember wot i did but the
>first code is working fine and the excel file exit without saving. i tried
[quoted text clipped - 61 lines]
>> >> >Thanks
>> >> >Kevin
Earl Kiosterud - 12 May 2008 06:30 GMT
Could a user not open the workbook with macros disabled, then be able to save his changed
copy?
Signature

Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------

> Stick these in Thisworkbook module.
>
[quoted text clipped - 31 lines]
>>Thanks
>>Kevin
Gord Dibben - 13 May 2008 01:43 GMT
Certainly Earl.

That is always an issue with code.

Only workaroiund for that is to render the workbook useless if users disable
macros.

Gord

>Could a user not open the workbook with macros disabled, then be able to save his changed
>copy?
Earl Kiosterud - 12 May 2008 06:27 GMT
Kevin,

Normally this is done with network permissions.  If the users have only read access, they
won't be able to save the file over the original.
Signature

Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------

> Hi,
> I have some formulas and data which is shared for the users to get their
[quoted text clipped - 4 lines]
> Thanks
> Kevin

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.