Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Tue, 22 Jul 2008 12:02:02 -0700,    group: microsoft.public.access.macros        back       


Export Excel Data   
Hi

I am trying to write a macro to export 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 Export window pop up.  What should I change in my macro to 
make it works?

Sub testEXPORT()

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.FixedFieldExport")

End Sub


Thanks
Joanne
date: Tue, 22 Jul 2008 12:02:02 -0700   author:   joannele71

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us