Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 163
Default EXCEL 2003 macro issue

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default EXCEL 2003 macro issue

Hi,

Like this

Public Sub CloseMe()
ActiveWorkbook.Close savechanges:=True
End Sub


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default EXCEL 2003 macro issue

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 163
Default EXCEL 2003 macro issue

Hi guys, thanks for your help with this.

When i run the macro now it doesnt close excel down, it stays open?

"Jacob Skaria" wrote:

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default EXCEL 2003 macro issue

What happens when you try the below....Save Changes set to False..

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close False
End Sub


--
Jacob


"Neil Holden" wrote:

Hi guys, thanks for your help with this.

When i run the macro now it doesnt close excel down, it stays open?

"Jacob Skaria" wrote:

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 163
Default EXCEL 2003 macro issue

Hi Jacob, it closes excel but not fully. An empty window of excel remains
once the macro runs? The trouble with this is, the file is still saying its
open?

Also how do i get the macro to automatically run when the excel sheet opens?

"Jacob Skaria" wrote:

What happens when you try the below....Save Changes set to False..

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close False
End Sub


--
Jacob


"Neil Holden" wrote:

Hi guys, thanks for your help with this.

When i run the macro now it doesnt close excel down, it stays open?

"Jacob Skaria" wrote:

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default EXCEL 2003 macro issue

OK Try the below to quit excel after closing the file

ActiveWorkbook.Close True
Application.DisplayAlerts = False
Application.Quit

Use the Sheet Activate event which gets triggered when a sheet is activated///

Private Sub Worksheet_Activate()
End Sub

OR the workbook open event that gets triggered when the workbook gets open

Private Sub Workbook_Open()
End Sub


--
Jacob


"Neil Holden" wrote:

Hi Jacob, it closes excel but not fully. An empty window of excel remains
once the macro runs? The trouble with this is, the file is still saying its
open?

Also how do i get the macro to automatically run when the excel sheet opens?

"Jacob Skaria" wrote:

What happens when you try the below....Save Changes set to False..

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close False
End Sub


--
Jacob


"Neil Holden" wrote:

Hi guys, thanks for your help with this.

When i run the macro now it doesnt close excel down, it stays open?

"Jacob Skaria" wrote:

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 163
Default EXCEL 2003 macro issue

Hello, it works but only so much, it leaves excel open but closes the
workbook. I need the entire excel to close?

Thanks for your help with this.

"Jacob Skaria" wrote:

OK Try the below to quit excel after closing the file

ActiveWorkbook.Close True
Application.DisplayAlerts = False
Application.Quit

Use the Sheet Activate event which gets triggered when a sheet is activated///

Private Sub Worksheet_Activate()
End Sub

OR the workbook open event that gets triggered when the workbook gets open

Private Sub Workbook_Open()
End Sub


--
Jacob


"Neil Holden" wrote:

Hi Jacob, it closes excel but not fully. An empty window of excel remains
once the macro runs? The trouble with this is, the file is still saying its
open?

Also how do i get the macro to automatically run when the excel sheet opens?

"Jacob Skaria" wrote:

What happens when you try the below....Save Changes set to False..

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close False
End Sub


--
Jacob


"Neil Holden" wrote:

Hi guys, thanks for your help with this.

When i run the macro now it doesnt close excel down, it stays open?

"Jacob Skaria" wrote:

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default EXCEL 2003 macro issue

The below should quit excel

Application.DisplayAlerts = False
Application.Quit

--
Jacob


"Neil Holden" wrote:

Hello, it works but only so much, it leaves excel open but closes the
workbook. I need the entire excel to close?

Thanks for your help with this.

"Jacob Skaria" wrote:

OK Try the below to quit excel after closing the file

ActiveWorkbook.Close True
Application.DisplayAlerts = False
Application.Quit

Use the Sheet Activate event which gets triggered when a sheet is activated///

Private Sub Worksheet_Activate()
End Sub

OR the workbook open event that gets triggered when the workbook gets open

Private Sub Workbook_Open()
End Sub


--
Jacob


"Neil Holden" wrote:

Hi Jacob, it closes excel but not fully. An empty window of excel remains
once the macro runs? The trouble with this is, the file is still saying its
open?

Also how do i get the macro to automatically run when the excel sheet opens?

"Jacob Skaria" wrote:

What happens when you try the below....Save Changes set to False..

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close False
End Sub


--
Jacob


"Neil Holden" wrote:

Hi guys, thanks for your help with this.

When i run the macro now it doesnt close excel down, it stays open?

"Jacob Skaria" wrote:

Try the below...True specifies that the workbook to be saved...

ActiveWorkbook.Close True

--
Jacob


"Neil Holden" wrote:

Hi all gurus, help would be appreciated if you can.

I have an excel workbook set on a scheldule and every night at 2 am it will
open, i need all the cells updating and the full excel workbook to close
after 15 seconds.

The code below asks me to save it, i need all this to be done automatically.

Public Sub Test_Me()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:15"), "CloseMe"
End Sub

Public Sub CloseMe()
Application.ActiveWorkbook.Close
End Sub


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
Excel 2003 compatibility issue news4naeem Excel Discussion (Misc queries) 0 January 15th 10 06:06 AM
excel 2003 issue jgb1270 Excel Worksheet Functions 0 March 18th 09 03:34 PM
Issue link Excel 2003 Abast Excel Discussion (Misc queries) 1 September 18th 08 09:46 AM
Issue with Excel 2003 Good Intentions New Users to Excel 3 April 10th 06 07:36 PM
excel 2003 issue yazh Excel Discussion (Misc queries) 1 September 2nd 05 07:10 PM


All times are GMT +1. The time now is 02:13 PM.

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"