LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
SAm
 
Posts: n/a
Default automation from access into excel

Hi

i have never been to the excel boards. i am not sure if it is apprpriate to
post both on access and excel groups. so i will try now, and if it isn't
cool, please let me know.

i generate a report on access then i export it to word. then i copy it from
word and i am trying to paste it into excel. i am the lease familiar with vba
in excel. i am having problems with the excel end of things. the following is
my code:

Code:
Set MyWordInstance = New Word.Application
MyWordInstance.Documents.Open "C:\tempRpt.rtf"
With MyWordInstance
.Selection.WholeStory
.Selection.Find.ClearFormatting
.Selection.Find.Replacement.ClearFormatting
With .Selection.Find
.Text = "^m"
.Replacement.Text = ""
.Forward = True
End With
.Selection.Find.Execute Replace:=wdReplaceAll
.Selection.WholeStory
.Selection.Copy
End With
MyWordInstance.ActiveDocument.Close
MyWordInstance.Quit
Kill "C:\tempPayperiodRpt.rtf"

' all of the above works fine, the following is giving me some problems

Set MyExcelInstance = New Excel.Application
MyExcelInstance.Workbooks.Add
MyExcelInstance.ActiveWorkbook.SaveAs "C:\PPP"
MyExcelInstance.ActiveWorkbook.ActiveSheet.Range(" B5").Select
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("B5")
MyExcelInstance.ActiveWorkbook.Save
MyExcelInstance.ActiveWorkbook.Close
MyExcelInstance.Quit
 
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
Financial modelling from Excel to Access Huyeote Excel Discussion (Misc queries) 3 March 9th 11 03:59 PM
excel to access problem keithl816 Excel Discussion (Misc queries) 9 November 30th 05 11:52 PM
Access a excel file through FTP without write protection jj Excel Discussion (Misc queries) 0 October 9th 05 05:38 PM
Excel won't open - pasting from Access Rebecca Excel Discussion (Misc queries) 0 May 25th 05 12:15 AM
Changing the format of an Excel output file made by Microsoft Access Amir Excel Discussion (Misc queries) 2 May 1st 05 12:57 AM


All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"