Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with import files by excel macro | Excel Discussion (Misc queries) | |||
problem with import files by excel macro | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
External data Macro Problem Excel 97 | Excel Discussion (Misc queries) |