Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109111 > unrolled thread

Email on save

Started byPaul Doucette <pauld@mewood.com>
First post2016-07-27 08:18 -0700
Last post2016-08-04 00:33 +0100
Articles 20 on this page of 24 — 10 participants

Back to article view | Back to microsoft.public.excel.programming


Contents

  Email on save Paul Doucette <pauld@mewood.com> - 2016-07-27 08:18 -0700
    Re: Email on save Claus Busch <claus_busch@t-online.de> - 2016-07-27 17:28 +0200
    Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-07-27 10:06 -0700
    Re: Email on save "Auric__" <not.my.real@email.address> - 2016-07-27 18:12 +0000
      Re: Email on save "Auric__" <not.my.real@email.address> - 2016-07-27 18:15 +0000
        Re: Email on save Claus Busch <claus_busch@t-online.de> - 2016-07-27 21:53 +0200
          Re: Email on save "Auric__" <not.my.real@email.address> - 2016-07-28 07:25 +0000
          Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-07-29 10:35 -0700
            Re: Email on save Claus Busch <claus_busch@t-online.de> - 2016-07-29 19:58 +0200
              Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-07-29 12:12 -0700
                Re: Email on save Claus Busch <claus_busch@t-online.de> - 2016-07-29 21:43 +0200
                  Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-07-29 13:42 -0700
                  Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-08-03 13:58 -0700
                    Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-08-03 15:32 -0700
                      Re: Email on save Claus Busch <claus_busch@t-online.de> - 2016-08-04 00:57 +0200
            Re: Email on save GS <gs@v.invalid> - 2016-07-29 14:27 -0400
              Re: Email on save GS <gs@v.invalid> - 2016-07-30 11:51 -0400
    Re: Email on save Paul Doucette <pauld@mewood.com> - 2016-07-27 11:33 -0700
    Re: Email on save ltomama0945 <ltomama0945@gmail.com> - 2016-07-29 02:10 +0100
    Re: Email on save Tindien3579pro <Tindien3579pro@gmail.com> - 2016-07-29 06:19 +0100
    Re: Email on save phukienxk123 <phukienxk123@gmail.com> - 2016-07-29 18:47 +0100
    Re: Email on save BùiÁnhn1 <TrầnSangf5@gmail.com> - 2016-07-30 11:42 +0100
    Re: Email on save NgoHuyeenc7 <BuiHuyeen d8@gmail.com> - 2016-07-31 05:01 +0100
    Re: Email on save banhtrungthu68 <banhtrungthu68@gmail.com> - 2016-08-04 00:33 +0100

Page 1 of 2  [1] 2  Next page →


#109111 — Email on save

FromPaul Doucette <pauld@mewood.com>
Date2016-07-27 08:18 -0700
SubjectEmail on save
Message-ID<81a01e12-0b1a-4c93-8cf1-7cf700150714@googlegroups.com>
Is there a way I can set up my spreadsheet to send an email to alert others in my company that it has been updated, every time I save it?
Thanks!
Paul

[toc] | [next] | [standalone]


#109112

FromClaus Busch <claus_busch@t-online.de>
Date2016-07-27 17:28 +0200
Message-ID<nnajv2$b4o$1@dont-email.me>
In reply to#109111
Hi Paul,

Am Wed, 27 Jul 2016 08:18:23 -0700 (PDT) schrieb Paul Doucette:

> Is there a way I can set up my spreadsheet to send an email to alert others in my company that it has been updated, every time I save it?

write the code for the email in the Workbook_BeforeSave event


Regards
Claus B.
-- 
Windows10
Office 2016

[toc] | [prev] | [next] | [standalone]


#109113

FromPaul Doucette <pauld@mewood.com>
Date2016-07-27 10:06 -0700
Message-ID<1cfea309-70d8-4d0d-9bb6-12bbca6bcdb0@googlegroups.com>
In reply to#109111
On Wednesday, July 27, 2016 at 11:18:52 AM UTC-4, Paul Doucette wrote:
> Is there a way I can set up my spreadsheet to send an email to alert others in my company that it has been updated, every time I save it?
> Thanks!
> Paul

Thanks Claus!

[toc] | [prev] | [next] | [standalone]


#109115

From"Auric__" <not.my.real@email.address>
Date2016-07-27 18:12 +0000
Message-ID<XnsA652720C98C0Dauricauricauricauric@213.239.209.88>
In reply to#109111
Paul Doucette wrote:

> Is there a way I can set up my spreadsheet to send an email to alert others
> in my company that it has been updated, every time I save it?

I have to ask, do you *really* want to generate an email alert *every time 
you save*? This strikes me as a really bad idea. I tend to save my 
spreadsheets every time I change *anything*; I doubt folks would like to 
receive 600 emails a day from me saying "lol changed the spreadsheet again".

Instead, I would do something like this (in the spreadsheet's ThisWorkbook 
class):

  Private saved As Boolean

  Private Sub Workbook_Open()
    saved = False
  End Sub

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

  Private Sub Workbook_BeforeClose(Cancel As Boolean)
    If saved Then generateEmail
  End Sub

  Public Sub generateEmail()
    'send the email; you figure out how
    'then...
    saved = False
  End Sub

This way, you can send the email reports via code whenever you want, but if 
you forget to, it happens automagically when you close the spreadsheet.

-- 
Their education has been sadly neglected.

[toc] | [prev] | [next] | [standalone]


#109116

From"Auric__" <not.my.real@email.address>
Date2016-07-27 18:15 +0000
Message-ID<XnsA65272859592Cauricauricauricauric@213.239.209.88>
In reply to#109115
I wrote:

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

...or alternately:

  Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
                                          Cancel As Boolean)
    saved = True
    If MsgBox("Generate email?", vbYesNoCancel) = vbYes Then generateEmail
  End Sub

-- 
Playing war games with other people's lives...
It should be *you* on the front line!

[toc] | [prev] | [next] | [standalone]


#109122

FromClaus Busch <claus_busch@t-online.de>
Date2016-07-27 21:53 +0200
Message-ID<nnb3fr$7qg$1@dont-email.me>
In reply to#109116
Hi Auric,

Am Wed, 27 Jul 2016 18:15:27 -0000 (UTC) schrieb Auric__:

>   Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
>                                           Cancel As Boolean)
>     saved = True
>     If MsgBox("Generate email?", vbYesNoCancel) = vbYes Then generateEmail
>   End Sub

it is a good idea to use a MsgBox. But it is also annoying when the
MsgBox appears 600 times.
Maybe it is better to put the code in the WorkBook_BeforeClose event.


Regards
Claus B.
-- 
Windows10
Office 2016

[toc] | [prev] | [next] | [standalone]


#109124

From"Auric__" <not.my.real@email.address>
Date2016-07-28 07:25 +0000
Message-ID<XnsA65344311637auricauricauricauric@213.239.209.88>
In reply to#109122
Claus Busch wrote:

> Hi Auric,
> 
> Am Wed, 27 Jul 2016 18:15:27 -0000 (UTC) schrieb Auric__:
> 
>>   Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
>>                                           Cancel As Boolean)
>>     saved = True
>>     If MsgBox("Generate email?", vbYesNoCancel) = vbYes Then
>>     generateEmail 
>>   End Sub
> 
> it is a good idea to use a MsgBox. But it is also annoying when the
> MsgBox appears 600 times.
> Maybe it is better to put the code in the WorkBook_BeforeClose event.

The entire idea was to remind the user about the email and give them some way 
to decide whether or not to send the email. Feel free to suggest a better 
option.

-- 
One doesn't discover new lands without consenting to lose sight of the
shore for a very long time.
 -- Andre Gide

[toc] | [prev] | [next] | [standalone]


#109127

FromPaul Doucette <pauld@mewood.com>
Date2016-07-29 10:35 -0700
Message-ID<674f11e3-711b-443d-8fd1-287ed72ccee3@googlegroups.com>
In reply to#109122
On Wednesday, July 27, 2016 at 3:53:36 PM UTC-4, Claus Busch wrote:
> Hi Auric,
> 
> Am Wed, 27 Jul 2016 18:15:27 -0000 (UTC) schrieb Auric__:
> 
> >   Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
> >                                           Cancel As Boolean)
> >     saved = True
> >     If MsgBox("Generate email?", vbYesNoCancel) = vbYes Then generateEmail
> >   End Sub
> 
> it is a good idea to use a MsgBox. But it is also annoying when the
> MsgBox appears 600 times.
> Maybe it is better to put the code in the WorkBook_BeforeClose event.
> 
> 
> Regards
> Claus B.
> -- 
> Windows10
> Office 2016

I believe your option will work better Claus. But I could still use some help. This spreadsheet is used for listing new orders. The girl who enters the orders put a new order in the next available (empty) row on Sheet1. After she has done that, she hit's save so that she does not lose her work. It is at that point that I would like the workbook to alert other users. The other users (there are 3 or 4 of them) need to be alerted as soon as possible that a new order has been entered so that they can begin assembling product. They have been just opening the "neworders" workbook randomly to check to see if new data has been entered into the next available row. It would be more efficient if they received an email alert when she has put data into a new row, and saved. 
HOWEVER she also sometimes deletes completed rows and saves. I do not want the other users alerted at those times.
Thoughts?
Thank you, Paul

[toc] | [prev] | [next] | [standalone]


#109129

FromClaus Busch <claus_busch@t-online.de>
Date2016-07-29 19:58 +0200
Message-ID<nng5h1$vpo$1@dont-email.me>
In reply to#109127
Hi Paul,

Am Fri, 29 Jul 2016 10:35:00 -0700 (PDT) schrieb Paul Doucette:

> I believe your option will work better Claus. But I could still use some help. This spreadsheet is used for listing new orders. The girl who enters the orders put a new order in the next available (empty) row on Sheet1. After she has done that, she hit's save so that she does not lose her work. It is at that point that I would like the workbook to alert other users. The other users (there are 3 or 4 of them) need to be alerted as soon as possible that a new order has been entered so that they can begin assembling product. They have been just opening the "neworders" workbook randomly to check to see if new data has been entered into the next available row. It would be more efficient if they received an email alert when she has put data into a new row, and saved. 
> HOWEVER she also sometimes deletes completed rows and saves. I do not want the other users alerted at those times.

in which range the new order will be entered? Does she enter the new
order from A on in each cell?


Regards
Claus B.
-- 
Windows10
Office 2016

[toc] | [prev] | [next] | [standalone]


#109131

FromPaul Doucette <pauld@mewood.com>
Date2016-07-29 12:12 -0700
Message-ID<df8d69a1-214c-4563-a466-0430f700ac2d@googlegroups.com>
In reply to#109129
On Friday, July 29, 2016 at 1:59:02 PM UTC-4, Claus Busch wrote:
> Hi Paul,
> 
> Am Fri, 29 Jul 2016 10:35:00 -0700 (PDT) schrieb Paul Doucette:
> 
> > I believe your option will work better Claus. But I could still use some help. This spreadsheet is used for listing new orders. The girl who enters the orders put a new order in the next available (empty) row on Sheet1. After she has done that, she hit's save so that she does not lose her work. It is at that point that I would like the workbook to alert other users. The other users (there are 3 or 4 of them) need to be alerted as soon as possible that a new order has been entered so that they can begin assembling product. They have been just opening the "neworders" workbook randomly to check to see if new data has been entered into the next available row. It would be more efficient if they received an email alert when she has put data into a new row, and saved. 
> > HOWEVER she also sometimes deletes completed rows and saves. I do not want the other users alerted at those times.
> 
> in which range the new order will be entered? Does she enter the new
> order from A on in each cell?
> 
> 
> Regards
> Claus B.
> -- 
> Windows10
> Office 2016

Yes, that's correct. A through J in that order.

[toc] | [prev] | [next] | [standalone]


#109132

FromClaus Busch <claus_busch@t-online.de>
Date2016-07-29 21:43 +0200
Message-ID<nngbkr$mqu$1@dont-email.me>
In reply to#109131
Hi Paul,

Am Fri, 29 Jul 2016 12:12:31 -0700 (PDT) schrieb Paul Doucette:

> Yes, that's correct. A through J in that order.

in a standard module:

Public LRowOld As Long
Sub RowCheck()
LRowOld = Cells(Rows.Count, 1).End(xlUp).Row
End Sub

In module of Sheet1:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then RowCheck
End Sub

In module of workbook:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim LRow As Long

LRow = Sheets("Sheet1").UsedRange.Rows.Count
If LRow = LRowOld Then Exit Sub
'Insert here the code to create your email
End Sub


Regards
Claus B.
-- 
Windows10
Office 2016

[toc] | [prev] | [next] | [standalone]


#109133

FromPaul Doucette <pauld@mewood.com>
Date2016-07-29 13:42 -0700
Message-ID<5d9a814e-e5c9-4cd6-b66c-a4fcf797ff64@googlegroups.com>
In reply to#109132
On Friday, July 29, 2016 at 3:43:28 PM UTC-4, Claus Busch wrote:
> Hi Paul,
> 
> Am Fri, 29 Jul 2016 12:12:31 -0700 (PDT) schrieb Paul Doucette:
> 
> > Yes, that's correct. A through J in that order.
> 
> in a standard module:
> 
> Public LRowOld As Long
> Sub RowCheck()
> LRowOld = Cells(Rows.Count, 1).End(xlUp).Row
> End Sub
> 
> In module of Sheet1:
> 
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Count > 1 Then RowCheck
> End Sub
> 
> In module of workbook:
> 
> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
> Boolean)
> Dim LRow As Long
> 
> LRow = Sheets("Sheet1").UsedRange.Rows.Count
> If LRow = LRowOld Then Exit Sub
> 'Insert here the code to create your email
> End Sub
> 
> 
> Regards
> Claus B.
> -- 
> Windows10
> Office 2016

THANKS! Will try it as soon as I can get in the workbook on my own!

[toc] | [prev] | [next] | [standalone]


#109147

FromPaul Doucette <pauld@mewood.com>
Date2016-08-03 13:58 -0700
Message-ID<3e05327c-5525-4e7f-9574-ec7f1b476acf@googlegroups.com>
In reply to#109132
On Friday, July 29, 2016 at 3:43:28 PM UTC-4, Claus Busch wrote:
> Hi Paul,
> 
> Am Fri, 29 Jul 2016 12:12:31 -0700 (PDT) schrieb Paul Doucette:
> 
> > Yes, that's correct. A through J in that order.
> 
> in a standard module:
> 
> Public LRowOld As Long
> Sub RowCheck()
> LRowOld = Cells(Rows.Count, 1).End(xlUp).Row
> End Sub
> 
> In module of Sheet1:
> 
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Count > 1 Then RowCheck
> End Sub
> 
> In module of workbook:
> 
> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
> Boolean)
> Dim LRow As Long
> 
> LRow = Sheets("Sheet1").UsedRange.Rows.Count
> If LRow = LRowOld Then Exit Sub
> 'Insert here the code to create your email
> End Sub
> 
> 
> Regards
> Claus B.
> -- 
> Windows10
> Office 2016

Hi Claus.
This is working very well! So far no complaints!!
I have one more modification to the code they are wondering about, if it is possible :-) It is now sending the email with a message in it. Could we get it to send the email with the information from the new Row(s) that has been entered? That way they would be able to see the new information at a glance and not have to open the workbook if they do not feel the need.
Thank you again! Paul

[toc] | [prev] | [next] | [standalone]


#109148

FromPaul Doucette <pauld@mewood.com>
Date2016-08-03 15:32 -0700
Message-ID<327cd992-1116-414b-93fe-6a2c46c6b50d@googlegroups.com>
In reply to#109147
On Wednesday, August 3, 2016 at 4:58:16 PM UTC-4, Paul Doucette wrote:
> On Friday, July 29, 2016 at 3:43:28 PM UTC-4, Claus Busch wrote:
> > Hi Paul,
> > 
> > Am Fri, 29 Jul 2016 12:12:31 -0700 (PDT) schrieb Paul Doucette:
> > 
> > > Yes, that's correct. A through J in that order.
> > 
> > in a standard module:
> > 
> > Public LRowOld As Long
> > Sub RowCheck()
> > LRowOld = Cells(Rows.Count, 1).End(xlUp).Row
> > End Sub
> > 
> > In module of Sheet1:
> > 
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > If Target.Count > 1 Then RowCheck
> > End Sub
> > 
> > In module of workbook:
> > 
> > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
> > Boolean)
> > Dim LRow As Long
> > 
> > LRow = Sheets("Sheet1").UsedRange.Rows.Count
> > If LRow = LRowOld Then Exit Sub
> > 'Insert here the code to create your email
> > End Sub
> > 
> > 
> > Regards
> > Claus B.
> > -- 
> > Windows10
> > Office 2016
> 
> Hi Claus.
> This is working very well! So far no complaints!!
> I have one more modification to the code they are wondering about, if it is possible :-) It is now sending the email with a message in it. Could we get it to send the email with the information from the new Row(s) that has been entered? That way they would be able to see the new information at a glance and not have to open the workbook if they do not feel the need.
> Thank you again! Paul

And again, in the body of the email it would always be columns A though J. And it would be the rows added since the last save.
Thanks, Paul

[toc] | [prev] | [next] | [standalone]


#109149

FromClaus Busch <claus_busch@t-online.de>
Date2016-08-04 00:57 +0200
Message-ID<nntss0$ou6$1@dont-email.me>
In reply to#109148
Hi Paul,

Am Wed, 3 Aug 2016 15:32:34 -0700 (PDT) schrieb Paul Doucette:

> And again, in the body of the email it would always be columns A though J. And it would be the rows added since the last save.

I sent you an email


Regards
Claus B.
-- 
Windows10
Office 2016

[toc] | [prev] | [next] | [standalone]


#109130

FromGS <gs@v.invalid>
Date2016-07-29 14:27 -0400
Message-ID<nng76l$6k7$1@dont-email.me>
In reply to#109127
> HOWEVER she also sometimes deletes completed rows and saves. I do not 
> want the other users alerted at those times.
> Thoughts?

I like Auric_'s idea using the MsgBox for this! (very K.I.S.S.)

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

[toc] | [prev] | [next] | [standalone]


#109135

FromGS <gs@v.invalid>
Date2016-07-30 11:51 -0400
Message-ID<nniidl$vnl$1@dont-email.me>
In reply to#109130
FWIW
The approach I use doesn't involve Workbook events. (In fact I NEVER 
use code in the 'ThisWorkbook' component to avoid problems of code not 
working if the workbook becomes corrupt!) Saves are done normally as 
per user normal work practice. Here's some sample code...


In a standard module named "m_OpenClose":

  Option Explicit
  ' This module handles all startup/shutdown processes

  '[Global Variable Defs]
  Const gbDevMode As Boolean = False 'True'
    '//set True to skip runtime UI settings during design time

  Public gbSettingsAreStored As Boolean

  '[Module Variable Defs]
  Const msModule$ = "m_OpenClose" '//used for logging

  '[Enums]

  '[UDTs]
  Private Type udtSettings
    SettingsAreStored As Boolean

    VisibleCommandbars As String
    DisplayStatusBar As Boolean
    DisplayFormulaBar As Boolean
    ShowWindowsInTaskbar As Boolean
    IgnoreRemoteRequests As Boolean
    DisplayCommentIndicator As Boolean

    'With Commandbars
    CustomizeToolbars As Boolean
    ViewToolbarList As Boolean
    EnableDesktop As Boolean

    'With editing
    Calculation As Long
    EditDirectlyInCell As Boolean
    AlertBeforeOverwriting As Boolean
    CellDragAndDrop As Boolean
    CopyObjectsWithCells As Boolean
    MoveAfterReturn As Boolean
    MoveAfterReturnDirection As Long

    'Version 10+
    AutoRecoverEnabled As Boolean
    'With Commandbars
    DisableAskAQuestionDropdown As Boolean
    'With ErrorCheckingOptions
    InconsistentFormula As Boolean
    UnlockedFormulaCells As Boolean
    NumberAsText As Boolean
  End Type
  Public AppSettings As udtSettings

  '[APIs]

  '[Conditionals]


  Sub Auto_Open()
  ' An Excel Autorun macro to replace the Workbook_Open event.
  ' Handles all startup processes.
  Const sSource$ = "Auto_Open()"

    'On startup...
    InitGlobals '//initialize global variables
    'If <startup condition> Then Startup Else Shutdown

  End Sub 'Auto_Open

  Sub Startup()
  Const sSource$ = "Startup()"
    StoreExcelSettings '//loads user default settings into a UDT
    SetupUI '//configures Excel as desired
    CreateMenus '//sets up any custom menus/toolbars used
  End Sub 'Startup

  Sub Auto_Close()
  ' An Excel Autorun macro to replace the Workbook_BeforeClose event.
  ' Handles all shutdown processes.
  Const sSource$ = "Auto_Close()"

    'On shutdown conditionals
    'Prompt to notify other users of changes
    Dim vAns
    Const sMsg$ = "Do you want to Notify others of your changes?"
    vAns = MsgBox(sMsg, vbYesNo+vbQuestion, "Notification of Changes")
    If vAns = vbYes Then NotifyOtherUsers

    Call Shutdown
  End Sub 'Auto_Close

  Sub Shutdown()
  Const sSource$ = "Shutdown()"
    DeleteMenus '//remove any custom menus/toolbars created
    CleanupUI '//undo changes made by SetupUI
    RestoreExcelSettings '//reset stored user default settings
  End Sub 'Shutdown

  Sub NotifyOtherUsers()
  ' This is where you put code to notify others of changes
  Const sSource$ = "NotifyOtherUsers()"
    '...
  End Sub 'NotifyOtherUsers


Sub StoreExcelSettings()
' This stores Excel's settings on startup

Const sSource As String = "StoreExcelSettings()"

  Dim oTemp As Object
  Dim wkbTemp As Object 'gAppXL.Workbook
  Dim sBarNames As String

  
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  If gAppXL Is Nothing Then Set gAppXL = Application  '//vba only
  
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

  'Skip errors in case we can't use the Registry
'  On Error Resume Next

  'Check if we've already stored the settings
  '(so don't want to overwrite them)
'  If Not gbSettingsAreStored Then

    'Store the current Excel settings in AppSettings
    With gAppXL

      'Some properties require a workbook to be open
      If .ActiveWorkbook Is Nothing Then .ScreenUpdating = False: Set 
wkbTemp = .Workbooks.Add

      AppSettings.DisplayStatusBar = .DisplayStatusBar
      AppSettings.DisplayFormulaBar = .DisplayFormulaBar
      AppSettings.DisplayCommentIndicator = .DisplayCommentIndicator
      AppSettings.CustomizeToolbars = 
.CommandBars("Tools").Controls("Customize...").Enabled
      AppSettings.ViewToolbarList = .CommandBars("Toolbar 
List").Enabled
      AppSettings.EnableDesktop = .CommandBars("Desktop").Enabled
      AppSettings.IgnoreRemoteRequests = .IgnoreRemoteRequests
      AppSettings.Calculation = .Calculation
      AppSettings.AlertBeforeOverwriting = .AlertBeforeOverwriting
      AppSettings.CellDragAndDrop = .CellDragAndDrop
      AppSettings.CopyObjectsWithCells = .CopyObjectsWithCells
      AppSettings.EditDirectlyInCell = .EditDirectlyInCell
      AppSettings.MoveAfterReturn = .MoveAfterReturn
      AppSettings.MoveAfterReturnDirection = .MoveAfterReturnDirection
      'insert others here as necessary

      'Which commandbars are visible
      For Each cmdBar In .CommandBars
        If cmdBar.Visible Then
          sBarNames = sBarNames & "," & cmdBar.name
        End If
      Next
      AppSettings.VisibleCommandbars = Mid$(sBarNames, 2)

      'Specific for Excel 2000 and up
      If Val(.VERSION) >= 9 Then AppSettings.ShowWindowsInTaskbar = 
.ShowWindowsInTaskbar

      'Special for Excel 2002 and up
      If Val(.VERSION) >= 10 Then
        Set oTemp = .CommandBars
        AppSettings.DisableAskAQuestionDropdown = 
oTemp.DisableAskAQuestionDropdown
        AppSettings.AutoRecoverEnabled = .AutoRecover.Enabled
        AppSettings.InconsistentFormula = 
.ErrorCheckingOptions.InconsistentFormula
        AppSettings.UnlockedFormulaCells = 
.ErrorCheckingOptions.UnlockedFormulaCells
        AppSettings.NumberAsText = .ErrorCheckingOptions.NumberAsText
      End If  'Val(.VERSION) >= 10
      AppSettings.SettingsAreStored = True
    End With  'gAppXL

    'Close up the temporary workbook
    If Not wkbTemp Is Nothing Then wkbTemp.Close False

    'Save the settings
'    PutDataInFile App.Path & gsSEP_PATH & gsAPP_FILE_SETTINGS, 
SettingsData  '//vb6
    PutDataInFile sAppPath & "\settings.dat", SettingsData  '//vba

    'Indicate that the settings have been stored.
    gbSettingsAreStored = True
'  End If  'gbSettingsAreStored

End Sub 'StoreExcelSettings()

Sub RestoreExcelSettings()
' Restores Excel setting we stored at startup

Const sSource As String = "RestoreExcelSettings()"

  Dim oTemp As Object
  Dim vRet As Variant

  
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  If gAppXL Is Nothing Then Set gAppXL = Application  '//vba only
  
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

  'we're shutting down
'  On Error Resume Next

  'Restore the original Excel settings
  With gAppXL

    'reset the window caption
    .Caption = .name

    'reset the sheet tab shortcut menu
    .CommandBars("Ply").Reset
    .CommandBars("Window").Reset

    'Restore the Excel settings
'    If gbSettingsAreStored Then
      .DisplayStatusBar = AppSettings.DisplayStatusBar
      .DisplayFormulaBar = AppSettings.DisplayFormulaBar
      .DisplayCommentIndicator = AppSettings.DisplayCommentIndicator
      .CommandBars("Tools").Controls("Customize...").Enabled = 
AppSettings.CustomizeToolbars
      .CommandBars("Toolbar List").Enabled = 
AppSettings.ViewToolbarList
      .CommandBars("Desktop").Enabled = AppSettings.EnableDesktop
      .IgnoreRemoteRequests = AppSettings.IgnoreRemoteRequests
      On Error Resume Next
      .Calculation = AppSettings.Calculation
      On Error GoTo 0
      .AlertBeforeOverwriting = AppSettings.AlertBeforeOverwriting
      .CellDragAndDrop = AppSettings.CellDragAndDrop
      .CopyObjectsWithCells = AppSettings.CopyObjectsWithCells
      .EditDirectlyInCell = AppSettings.EditDirectlyInCell
      .MoveAfterReturn = AppSettings.MoveAfterReturn
      .MoveAfterReturnDirection = AppSettings.MoveAfterReturnDirection
      'insert others here as necessary

      'Specific for Excel 2000 and up
      If Val(.VERSION) >= 9 Then .ShowWindowsInTaskbar = 
AppSettings.ShowWindowsInTaskbar

      'Specific for Excel 2002 and up
      If Val(.VERSION) >= 10 Then
        Set oTemp = gAppXL.CommandBars
        oTemp.DisableAskAQuestionDropdown = 
AppSettings.DisableAskAQuestionDropdown
        .AutoRecover.Enabled = AppSettings.AutoRecoverEnabled
        With .ErrorCheckingOptions
          .InconsistentFormula = AppSettings.InconsistentFormula
          .UnlockedFormulaCells = AppSettings.UnlockedFormulaCells
          .NumberAsText = AppSettings.NumberAsText
        End With
      End If  'Val(.VERSION) >= 10
'    End If  'gbSettingsAreStored
  End With

  'Open the 'toolbar.xlb' to prevent it from growing in size
  'This will restore the default Excel menubar in the event of a crash
  ''' DO NOT USE IF MENUBAR HAS BEEN CUSTOMIZED '''
  '//This application uses a menuitem on the Excel Menubar, so we won't 
restore the default//
'  RestoreMenus

  'Show the correct toolbars
  '//These were hidden by ConfigureWorkspace()//
  On Error Resume Next
  For Each mvBarName In Split(AppSettings.VisibleCommandbars, ",")
    gAppXL.CommandBars(mvBarName).Visible = True
  Next
  On Error GoTo 0

  'Once restored, reset our flag for next runtime
  AppSettings.SettingsAreStored = False
  gbSettingsAreStored = False

  'Save the settings
'  PutDataInFile App.Path & gsSEP_PATH & gsAPP_FILE_SETTINGS, 
SettingsData  '//vb6
  PutDataInFile sAppPath & "\settings.dat", SettingsData  '//vba

End Sub 'RestoreExcelSettings()

Note:
Saving setting to file is primarily for use with VB6 automation, but it 
allows for settings recovery in the event of a crash.

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

[toc] | [prev] | [next] | [standalone]


#109118

FromPaul Doucette <pauld@mewood.com>
Date2016-07-27 11:33 -0700
Message-ID<baba5c9c-48c4-470d-a30d-fc6c3966d5ec@googlegroups.com>
In reply to#109111
On Wednesday, July 27, 2016 at 11:18:52 AM UTC-4, Paul Doucette wrote:
> Is there a way I can set up my spreadsheet to send an email to alert others in my company that it has been updated, every time I save it?
> Thanks!
> Paul

Thank you! That may be a better option! :-) Appreciate your time!
-Paul

[toc] | [prev] | [next] | [standalone]


#109125

Fromltomama0945 <ltomama0945@gmail.com>
Date2016-07-29 02:10 +0100
Message-ID<ltomama0945.11e06b88@excelbanter.com>
In reply to#109111
"I Loved You" is a single by British deep house duo Blonde featuring
vocals from British singer Melissa Steel. The track uses interpolations
of "More", a song from the album of the same name by Canadian singer
Tamia. It was released through Parlophone on 30 November 2014 in the
United Kingdom. The song has peaked at number 7 on the UK Singles Chart.




-- 
ltomama0945

[toc] | [prev] | [next] | [standalone]


#109126

FromTindien3579pro <Tindien3579pro@gmail.com>
Date2016-07-29 06:19 +0100
Message-ID<Tindien3579pro.11e0a3c8@excelbanter.com>
In reply to#109111
CẦM CAVET XE GIÁ CAO NHẤT THỊ TRƯỜNG 0916556949
- Nháº*n cầm xe máy , xe tay ga các loại...... Không cần giữ
xe . 
- Cầm 70- 80% giá trị xe
- Thá»§ tục nhanh gọn , không rườm rÃ* , có tiền liền .
- Không cầm xe gian, xe không chÃ*nh chá»§, xe tháp.
Điều Kiện :
- Xe ChÃ*nh Chá»§ ,biển số ThÃ*nh Phố Hồ ChÃ* Minh , Chứng
minh nhân dân + há»™ khẩu thÃ*nh phố + 1 hóa đơn Ä‘iện phải
trùng địa chỉ với nhau mang lên để đối chiếu . 
- Người Ä‘i cầm phải lÃ* chá»§ xe vÃ* phải Ä‘i chÃ*nh chiếc
xe. LH: 0914776949




-- 
Tindien3579pro

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | microsoft.public.excel.programming


csiph-web