PC Review


Reply
Thread Tools Rate Thread

After SaveAs Event

 
 
ZipCurs
Guest
Posts: n/a
 
      6th Jan 2010
Hello,

I have a VBA application that appears to work fine. My only known issue is
that when I perform a manual Save As, I get a bunch of garbage on the active
window. I have had this problem and the exact same garbage when running
individual routines in the application, and have gotten rid of them with
Application.ScreenUpdating=False. Minimally, my problem is that I have no
clue where to put this after a manual SaveAs.

In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
during Save As operations.

Thank you for you help in advance.
 
Reply With Quote
 
 
 
 
Bob Umlas
Guest
Posts: n/a
 
      6th Jan 2010
you want the Workbook_beforesave event

"ZipCurs" <(E-Mail Removed)> wrote in message
news:323D3520-BDB2-4A71-B785-(E-Mail Removed)...
> Hello,
>
> I have a VBA application that appears to work fine. My only known issue
> is
> that when I perform a manual Save As, I get a bunch of garbage on the
> active
> window. I have had this problem and the exact same garbage when running
> individual routines in the application, and have gotten rid of them with
> Application.ScreenUpdating=False. Minimally, my problem is that I have no
> clue where to put this after a manual SaveAs.
>
> In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> Workbook_Activate, and Workbook_SheetActivate. None of these appear to
> run
> during Save As operations.
>
> Thank you for you help in advance.


 
Reply With Quote
 
Ryan H
Guest
Posts: n/a
 
      6th Jan 2010
Put it in this event.

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

End Sub

Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"ZipCurs" wrote:

> Hello,
>
> I have a VBA application that appears to work fine. My only known issue is
> that when I perform a manual Save As, I get a bunch of garbage on the active
> window. I have had this problem and the exact same garbage when running
> individual routines in the application, and have gotten rid of them with
> Application.ScreenUpdating=False. Minimally, my problem is that I have no
> clue where to put this after a manual SaveAs.
>
> In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> during Save As operations.
>
> Thank you for you help in advance.

 
Reply With Quote
 
Ryan H
Guest
Posts: n/a
 
      6th Jan 2010
Use this event. Hope this helps! If so, let me know, click "YES" below.


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

Application.ScreenUpdating = False

' your code here

Application.ScreenUpdating = True

End Sub

--
Cheers,
Ryan


"ZipCurs" wrote:

> Hello,
>
> I have a VBA application that appears to work fine. My only known issue is
> that when I perform a manual Save As, I get a bunch of garbage on the active
> window. I have had this problem and the exact same garbage when running
> individual routines in the application, and have gotten rid of them with
> Application.ScreenUpdating=False. Minimally, my problem is that I have no
> clue where to put this after a manual SaveAs.
>
> In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> during Save As operations.
>
> Thank you for you help in advance.

 
Reply With Quote
 
ZipCurs
Guest
Posts: n/a
 
      6th Jan 2010
Bob & Ryan,

I tried this before and I tried it again. It does not work. I even put a
"stop" in it to ensure that it is accessed, and it is. The problem is that
the garbage shows up after the BeforeSave. I even tried it with
ScreenUpdating left False.

I could imagine doing an automatic SaveAs in BeforeSave and then cancelling
the manual one but these seems a bit hardcore. Any other thoughts?

"Ryan H" wrote:

> Use this event. Hope this helps! If so, let me know, click "YES" below.
>
>
> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
>
> Application.ScreenUpdating = False
>
> ' your code here
>
> Application.ScreenUpdating = True
>
> End Sub
>
> --
> Cheers,
> Ryan
>
>
> "ZipCurs" wrote:
>
> > Hello,
> >
> > I have a VBA application that appears to work fine. My only known issue is
> > that when I perform a manual Save As, I get a bunch of garbage on the active
> > window. I have had this problem and the exact same garbage when running
> > individual routines in the application, and have gotten rid of them with
> > Application.ScreenUpdating=False. Minimally, my problem is that I have no
> > clue where to put this after a manual SaveAs.
> >
> > In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> > Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> > during Save As operations.
> >
> > Thank you for you help in advance.

 
Reply With Quote
 
ZipCurs
Guest
Posts: n/a
 
      6th Jan 2010
Bob,

Thank you for replying. Please see my response to Ryan H.

"Bob Umlas" wrote:

> you want the Workbook_beforesave event
>
> "ZipCurs" <(E-Mail Removed)> wrote in message
> news:323D3520-BDB2-4A71-B785-(E-Mail Removed)...
> > Hello,
> >
> > I have a VBA application that appears to work fine. My only known issue
> > is
> > that when I perform a manual Save As, I get a bunch of garbage on the
> > active
> > window. I have had this problem and the exact same garbage when running
> > individual routines in the application, and have gotten rid of them with
> > Application.ScreenUpdating=False. Minimally, my problem is that I have no
> > clue where to put this after a manual SaveAs.
> >
> > In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> > Workbook_Activate, and Workbook_SheetActivate. None of these appear to
> > run
> > during Save As operations.
> >
> > Thank you for you help in advance.

>
> .
>

 
Reply With Quote
 
Ryan H
Guest
Posts: n/a
 
      6th Jan 2010
This is a stretch but it might work. Read the help section on DoEvents.
Maybe your operating system has a lot going on and you need to let it finish
before VBA continues or maybe a weak video card. I'm just guessing. Hope it
helps! If so, let me know, click "YES" below.

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

Application.ScreenUpdating = False

' your code here
DoEvents
' your save code here

' the rest of your code here
DoEvents
Application.ScreenUpdating = True

End Sub

--
Cheers,
Ryan


"ZipCurs" wrote:

> Bob & Ryan,
>
> I tried this before and I tried it again. It does not work. I even put a
> "stop" in it to ensure that it is accessed, and it is. The problem is that
> the garbage shows up after the BeforeSave. I even tried it with
> ScreenUpdating left False.
>
> I could imagine doing an automatic SaveAs in BeforeSave and then cancelling
> the manual one but these seems a bit hardcore. Any other thoughts?
>
> "Ryan H" wrote:
>
> > Use this event. Hope this helps! If so, let me know, click "YES" below.
> >
> >
> > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> >
> > Application.ScreenUpdating = False
> >
> > ' your code here
> >
> > Application.ScreenUpdating = True
> >
> > End Sub
> >
> > --
> > Cheers,
> > Ryan
> >
> >
> > "ZipCurs" wrote:
> >
> > > Hello,
> > >
> > > I have a VBA application that appears to work fine. My only known issue is
> > > that when I perform a manual Save As, I get a bunch of garbage on the active
> > > window. I have had this problem and the exact same garbage when running
> > > individual routines in the application, and have gotten rid of them with
> > > Application.ScreenUpdating=False. Minimally, my problem is that I have no
> > > clue where to put this after a manual SaveAs.
> > >
> > > In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> > > Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> > > during Save As operations.
> > >
> > > Thank you for you help in advance.

 
Reply With Quote
 
ZipCurs
Guest
Posts: n/a
 
      6th Jan 2010
Ryan,

You have answered my question, although I don't plan to act on it. I will
live with a little cosmetic garbage after SaveAs. The primary issue is "your
save code here". I am not really excited about getting into having the right
version.

Thanks

"Ryan H" wrote:

> This is a stretch but it might work. Read the help section on DoEvents.
> Maybe your operating system has a lot going on and you need to let it finish
> before VBA continues or maybe a weak video card. I'm just guessing. Hope it
> helps! If so, let me know, click "YES" below.
>
> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
>
> Application.ScreenUpdating = False
>
> ' your code here
> DoEvents
> ' your save code here
>
> ' the rest of your code here
> DoEvents
> Application.ScreenUpdating = True
>
> End Sub
>
> --
> Cheers,
> Ryan
>
>
> "ZipCurs" wrote:
>
> > Bob & Ryan,
> >
> > I tried this before and I tried it again. It does not work. I even put a
> > "stop" in it to ensure that it is accessed, and it is. The problem is that
> > the garbage shows up after the BeforeSave. I even tried it with
> > ScreenUpdating left False.
> >
> > I could imagine doing an automatic SaveAs in BeforeSave and then cancelling
> > the manual one but these seems a bit hardcore. Any other thoughts?
> >
> > "Ryan H" wrote:
> >
> > > Use this event. Hope this helps! If so, let me know, click "YES" below.
> > >
> > >
> > > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> > >
> > > Application.ScreenUpdating = False
> > >
> > > ' your code here
> > >
> > > Application.ScreenUpdating = True
> > >
> > > End Sub
> > >
> > > --
> > > Cheers,
> > > Ryan
> > >
> > >
> > > "ZipCurs" wrote:
> > >
> > > > Hello,
> > > >
> > > > I have a VBA application that appears to work fine. My only known issue is
> > > > that when I perform a manual Save As, I get a bunch of garbage on the active
> > > > window. I have had this problem and the exact same garbage when running
> > > > individual routines in the application, and have gotten rid of them with
> > > > Application.ScreenUpdating=False. Minimally, my problem is that I have no
> > > > clue where to put this after a manual SaveAs.
> > > >
> > > > In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> > > > Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> > > > during Save As operations.
> > > >
> > > > Thank you for you help in advance.

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      7th Jan 2010
Try disabling the alerts...as below

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

Application.ScreenUpdating = False
Application.DisplayAlerts = False

' your code here

Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub


--
Jacob


"ZipCurs" wrote:

> Ryan,
>
> You have answered my question, although I don't plan to act on it. I will
> live with a little cosmetic garbage after SaveAs. The primary issue is "your
> save code here". I am not really excited about getting into having the right
> version.
>
> Thanks
>
> "Ryan H" wrote:
>
> > This is a stretch but it might work. Read the help section on DoEvents.
> > Maybe your operating system has a lot going on and you need to let it finish
> > before VBA continues or maybe a weak video card. I'm just guessing. Hope it
> > helps! If so, let me know, click "YES" below.
> >
> > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> >
> > Application.ScreenUpdating = False
> >
> > ' your code here
> > DoEvents
> > ' your save code here
> >
> > ' the rest of your code here
> > DoEvents
> > Application.ScreenUpdating = True
> >
> > End Sub
> >
> > --
> > Cheers,
> > Ryan
> >
> >
> > "ZipCurs" wrote:
> >
> > > Bob & Ryan,
> > >
> > > I tried this before and I tried it again. It does not work. I even put a
> > > "stop" in it to ensure that it is accessed, and it is. The problem is that
> > > the garbage shows up after the BeforeSave. I even tried it with
> > > ScreenUpdating left False.
> > >
> > > I could imagine doing an automatic SaveAs in BeforeSave and then cancelling
> > > the manual one but these seems a bit hardcore. Any other thoughts?
> > >
> > > "Ryan H" wrote:
> > >
> > > > Use this event. Hope this helps! If so, let me know, click "YES" below.
> > > >
> > > >
> > > > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> > > >
> > > > Application.ScreenUpdating = False
> > > >
> > > > ' your code here
> > > >
> > > > Application.ScreenUpdating = True
> > > >
> > > > End Sub
> > > >
> > > > --
> > > > Cheers,
> > > > Ryan
> > > >
> > > >
> > > > "ZipCurs" wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I have a VBA application that appears to work fine. My only known issue is
> > > > > that when I perform a manual Save As, I get a bunch of garbage on the active
> > > > > window. I have had this problem and the exact same garbage when running
> > > > > individual routines in the application, and have gotten rid of them with
> > > > > Application.ScreenUpdating=False. Minimally, my problem is that I have no
> > > > > clue where to put this after a manual SaveAs.
> > > > >
> > > > > In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> > > > > Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> > > > > during Save As operations.
> > > > >
> > > > > Thank you for you help in advance.

 
Reply With Quote
 
ZipCurs
Guest
Posts: n/a
 
      7th Jan 2010
Hello Jacob,

Thanks for your input. Your recommendation would work if I were willing to
insert SaveAs code in the "your code here" area, and Cancelling the manual
action. I have tried this and I don't want to deal with getting the versions
right, dealing with repeat names, etc. All I want to do is a simple action
after the SaveAs. Any thoughts would be welcome, but I think that I am done.

"Jacob Skaria" wrote:

> Try disabling the alerts...as below
>
> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
>
> Application.ScreenUpdating = False
> Application.DisplayAlerts = False
>
> ' your code here
>
> Application.ScreenUpdating = True
> Application.DisplayAlerts = True
>
> End Sub
>
>
> --
> Jacob
>
>
> "ZipCurs" wrote:
>
> > Ryan,
> >
> > You have answered my question, although I don't plan to act on it. I will
> > live with a little cosmetic garbage after SaveAs. The primary issue is "your
> > save code here". I am not really excited about getting into having the right
> > version.
> >
> > Thanks
> >
> > "Ryan H" wrote:
> >
> > > This is a stretch but it might work. Read the help section on DoEvents.
> > > Maybe your operating system has a lot going on and you need to let it finish
> > > before VBA continues or maybe a weak video card. I'm just guessing. Hope it
> > > helps! If so, let me know, click "YES" below.
> > >
> > > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> > >
> > > Application.ScreenUpdating = False
> > >
> > > ' your code here
> > > DoEvents
> > > ' your save code here
> > >
> > > ' the rest of your code here
> > > DoEvents
> > > Application.ScreenUpdating = True
> > >
> > > End Sub
> > >
> > > --
> > > Cheers,
> > > Ryan
> > >
> > >
> > > "ZipCurs" wrote:
> > >
> > > > Bob & Ryan,
> > > >
> > > > I tried this before and I tried it again. It does not work. I even put a
> > > > "stop" in it to ensure that it is accessed, and it is. The problem is that
> > > > the garbage shows up after the BeforeSave. I even tried it with
> > > > ScreenUpdating left False.
> > > >
> > > > I could imagine doing an automatic SaveAs in BeforeSave and then cancelling
> > > > the manual one but these seems a bit hardcore. Any other thoughts?
> > > >
> > > > "Ryan H" wrote:
> > > >
> > > > > Use this event. Hope this helps! If so, let me know, click "YES" below.
> > > > >
> > > > >
> > > > > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> > > > >
> > > > > Application.ScreenUpdating = False
> > > > >
> > > > > ' your code here
> > > > >
> > > > > Application.ScreenUpdating = True
> > > > >
> > > > > End Sub
> > > > >
> > > > > --
> > > > > Cheers,
> > > > > Ryan
> > > > >
> > > > >
> > > > > "ZipCurs" wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I have a VBA application that appears to work fine. My only known issue is
> > > > > > that when I perform a manual Save As, I get a bunch of garbage on the active
> > > > > > window. I have had this problem and the exact same garbage when running
> > > > > > individual routines in the application, and have gotten rid of them with
> > > > > > Application.ScreenUpdating=False. Minimally, my problem is that I have no
> > > > > > clue where to put this after a manual SaveAs.
> > > > > >
> > > > > > In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate,
> > > > > > Workbook_Activate, and Workbook_SheetActivate. None of these appear to run
> > > > > > during Save As operations.
> > > > > >
> > > > > > Thank you for you help in advance.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
thisworkbook.saveAs triggers change event? =?Utf-8?B?QWxlcmlvbg==?= Microsoft Excel Programming 3 6th Apr 2007 07:46 AM
Event Handling and SaveAs Sascha Rasmussen Microsoft Powerpoint 7 16th Feb 2007 10:24 AM
SaveAs closing file without firing event WorkBook_beforeclose PFS Microsoft Excel Programming 1 2nd Nov 2006 10:49 PM
Saveas web page shows Appointment and Event Details =?Utf-8?B?Um9iZXJ0IEdyaW1lcw==?= Microsoft Outlook Calendar 0 30th Jan 2006 02:09 PM
VBA capture File SaveAs Event Linda Mcfarlane Microsoft Excel Programming 2 17th Sep 2003 04:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:25 AM.