Excel application.quit in macro problem

T

TimkenSteve

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
 
B

Bob Phillips

Have you issued an Application.OnTime statement anywhere?

--
HTH

Bob Phillips

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

TimkenSteve

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
 
T

TimkenSteve

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top