Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10
Default Excel application.quit in macro problem

I've created a macro that begins with an auto_open importing,
reformatting, and saving data. In the same macro, I have an open excel
form. Next, Im attempting to application.quit the excel wb because it
isnt needed. When I enter a simple application quite before end sub, 30
seconds later, the excel re-opens and runs the process again. Anyone
ran into this before? Any ideas to stop this?
Thanks
Steve

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 8/16/2006 by seyers
'

'
ChDir "C:\SomeDir\"
Workbooks.OpenText Filename:= _
"C:\SomeDir\Data.TXT" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited,
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False,
Semicolon:=False _
, Comma:=True, Space:=False, Other:=False,
FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6,
1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1),
Array(13, 1), Array(14, 1)), _
TrailingMinusNumbers:=True
Cells.Select
Selection.NumberFormat = "General"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Range("A1").Select
ActiveCell.FormulaR1C1 = "Hello"
Columns("B:B").Select
Columns("A:A").ColumnWidth = 9.86
Range("B1").Select
ActiveCell.FormulaR1C1 = "Hellor"
Range("B2").Select
Columns("B:B").ColumnWidth = 14
Range("C1").Select
ActiveCell.FormulaR1C1 = "Hello"
Range("C4").Select
Columns("C:C").ColumnWidth = 11.57
Ect...............
ChDir "SomeDir\"
ActiveWorkbook.SaveAs Filename:= _
"SomeWB", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Dim objAccess As Access.Application
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("SomeDB.mdb")
objAccess.Visible = True
objAccess.DoCmd.OpenForm "SomeForm"

Application.Quit

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,593
Default Excel application.quit in macro problem

Have you issued an Application.OnTime statement anywhere?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TimkenSteve" wrote in message
oups.com...
I've created a macro that begins with an auto_open importing,
reformatting, and saving data. In the same macro, I have an open excel
form. Next, Im attempting to application.quit the excel wb because it
isnt needed. When I enter a simple application quite before end sub, 30
seconds later, the excel re-opens and runs the process again. Anyone
ran into this before? Any ideas to stop this?
Thanks
Steve

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 8/16/2006 by seyers
'

'
ChDir "C:\SomeDir\"
Workbooks.OpenText Filename:= _
"C:\SomeDir\Data.TXT" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited,
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False,
Semicolon:=False _
, Comma:=True, Space:=False, Other:=False,
FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6,
1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1),
Array(13, 1), Array(14, 1)), _
TrailingMinusNumbers:=True
Cells.Select
Selection.NumberFormat = "General"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Range("A1").Select
ActiveCell.FormulaR1C1 = "Hello"
Columns("B:B").Select
Columns("A:A").ColumnWidth = 9.86
Range("B1").Select
ActiveCell.FormulaR1C1 = "Hellor"
Range("B2").Select
Columns("B:B").ColumnWidth = 14
Range("C1").Select
ActiveCell.FormulaR1C1 = "Hello"
Range("C4").Select
Columns("C:C").ColumnWidth = 11.57
Ect...............
ChDir "SomeDir\"
ActiveWorkbook.SaveAs Filename:= _
"SomeWB", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Dim objAccess As Access.Application
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("SomeDB.mdb")
objAccess.Visible = True
objAccess.DoCmd.OpenForm "SomeForm"

Application.Quit

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10
Default Excel application.quit in macro problem

No. But when I take the application.quit out, it does not repeat. Is
there anyway to close excel without application quit?
Thanks for your help
Steve
Bob Phillips wrote:
Have you issued an Application.OnTime statement anywhere?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TimkenSteve" wrote in message
oups.com...
I've created a macro that begins with an auto_open importing,
reformatting, and saving data. In the same macro, I have an open excel
form. Next, Im attempting to application.quit the excel wb because it
isnt needed. When I enter a simple application quite before end sub, 30
seconds later, the excel re-opens and runs the process again. Anyone
ran into this before? Any ideas to stop this?
Thanks
Steve

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 8/16/2006 by seyers
'

'
ChDir "C:\SomeDir\"
Workbooks.OpenText Filename:= _
"C:\SomeDir\Data.TXT" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited,
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False,
Semicolon:=False _
, Comma:=True, Space:=False, Other:=False,
FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6,
1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1),
Array(13, 1), Array(14, 1)), _
TrailingMinusNumbers:=True
Cells.Select
Selection.NumberFormat = "General"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Range("A1").Select
ActiveCell.FormulaR1C1 = "Hello"
Columns("B:B").Select
Columns("A:A").ColumnWidth = 9.86
Range("B1").Select
ActiveCell.FormulaR1C1 = "Hellor"
Range("B2").Select
Columns("B:B").ColumnWidth = 14
Range("C1").Select
ActiveCell.FormulaR1C1 = "Hello"
Range("C4").Select
Columns("C:C").ColumnWidth = 11.57
Ect...............
ChDir "SomeDir\"
ActiveWorkbook.SaveAs Filename:= _
"SomeWB", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Dim objAccess As Access.Application
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("SomeDB.mdb")
objAccess.Visible = True
objAccess.DoCmd.OpenForm "SomeForm"

Application.Quit

End Sub


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10
Default Excel application.quit in macro problem

BIG IMPORTANT LEFT OUT
This only happens when I link the wb to a htm web page and open the wb
with the webpage itself
TimkenSteve wrote:
No. But when I take the application.quit out, it does not repeat. Is
there anyway to close excel without application quit?
Thanks for your help
Steve
Bob Phillips wrote:
Have you issued an Application.OnTime statement anywhere?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TimkenSteve" wrote in message
oups.com...
I've created a macro that begins with an auto_open importing,
reformatting, and saving data. In the same macro, I have an open excel
form. Next, Im attempting to application.quit the excel wb because it
isnt needed. When I enter a simple application quite before end sub, 30
seconds later, the excel re-opens and runs the process again. Anyone
ran into this before? Any ideas to stop this?
Thanks
Steve

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 8/16/2006 by seyers
'

'
ChDir "C:\SomeDir\"
Workbooks.OpenText Filename:= _
"C:\SomeDir\Data.TXT" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited,
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False,
Semicolon:=False _
, Comma:=True, Space:=False, Other:=False,
FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6,
1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1),
Array(13, 1), Array(14, 1)), _
TrailingMinusNumbers:=True
Cells.Select
Selection.NumberFormat = "General"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Range("A1").Select
ActiveCell.FormulaR1C1 = "Hello"
Columns("B:B").Select
Columns("A:A").ColumnWidth = 9.86
Range("B1").Select
ActiveCell.FormulaR1C1 = "Hellor"
Range("B2").Select
Columns("B:B").ColumnWidth = 14
Range("C1").Select
ActiveCell.FormulaR1C1 = "Hello"
Range("C4").Select
Columns("C:C").ColumnWidth = 11.57
Ect...............
ChDir "SomeDir\"
ActiveWorkbook.SaveAs Filename:= _
"SomeWB", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Dim objAccess As Access.Application
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("SomeDB.mdb")
objAccess.Visible = True
objAccess.DoCmd.OpenForm "SomeForm"

Application.Quit

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
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with import files by excel macro Raven Excel Discussion (Misc queries) 0 January 20th 06 08:23 AM
problem with import files by excel macro Raven Excel Discussion (Misc queries) 0 January 20th 06 08:22 AM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
External data Macro Problem Excel 97 Craig Kelly Excel Discussion (Misc queries) 1 January 17th 05 03:17 PM


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