Problem in running Excel sort function in Access using VBA 
Author Message
 Problem in running Excel sort function in Access using VBA

I have a problem in running sort function in Access using
VBA. I can't erase the object after I run the sort
function. Can anyone help me?

    Dim objxlSort      As New Excel.Application

    Set objxlSort = CreateObject("excel.application")
    Set rangesort = objxlSort.Workbooks.Open
("c:\test.xls")

    rangesort.Worksheets("Report_Sheet").Range
("a9:s100").Select
    Selection.Sort Key1:=Range
("S9"),Order1:=xlDescending, Header:=xlNo, _
        OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, SortMethod _
        :=xlPinYin, DataOption1:=xlSortNormal
    rangesort.Save
    rangesort.Close savechanges:=False
    objxlSort.Quit
    Set rangesort = Nothing
    Set objxlSort = Nothing

Pls help!!



Mon, 11 Jul 2005 01:14:02 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Running excel add-in (added into excel - not access) in Access VBA

2. Running VBA code in EXcel from VB6 using EXcel Objects

3. Running Excel function from Access function/macro

4. Problems with Access/Outlook 2K VBA when run using NT's AT command

5. Compatibility Problem Using MS Excel 97 VBA on Excel 2000/XP - Causes crashes

6. Exec. Word VBA Function From Access using VBA

7. VBA Excel sorting problem

8. Edit Access Record in Excel, then send back to Access using VBA

9. Using Excel Worksheet Functions in VBA

10. UNDO Function in Excel Macro by Using VBA

11. Using VBA time functions with excel macro

12. Using Excel VBA functions

 

 
Powered by phpBB® Forum Software