Hi
I am trying to write a macro to ex****t my data in Excel as a text file.
The
followings are my codes. However, the macro works only when I am running
it
manually on Excel. The macro fails to run when I schedule it to run. It
stops when the Ex****t window pop up. What should I change in my macro to
make it works?
Sub testEX****T()
Workbooks.Open(Filename:="c:\FLATFILE.XLA").RunAutoMacros Which:= _
xlAutoOpen
Workbooks("test.xls").Activate
Sheets("sheet1").Select
Range("A6").End(xlDown).Select
ActiveCell.Offset(0, 4).Select
anchor_cell2 = ActiveCell.Address
Range("A6", anchor_cell2).Select
Application.SendKeys ("c:\test.txt~")
Application.SendKeys ("Y~")
Application.Run Macro:=Range( _
"[FLATFILE.XLA]FLATFILE!mcp01.FixedFieldEx****t")
End Sub
Thanks
Joanne