Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have written code in Microsoft Project which creates an
excel workbook and then creates a report in excel from information in Project. When I have finished the report I want to sort it on a certain field, but I can't get the Sort to work. I have had various errors but the latest is "application or object defined error" I have set up the code like this (remembering that this is written in a module in Microsoft project) - Check to see if excel is running with Set MyXL = GetObject(, "Excel.Application") and if this produces an error I start Excel with Set MyXL = CreateObject("Excel.Application") I then create a new workbook with MyXL.Application.Workbooks.Add outbook = MyXL.Application.ActiveWorkbook.Name and then proceed to fill the report using: With MyXL.Application.Workbooks(outbook).ActiveSheet <fill report with data While still within the WITH statement I have tried to sort the report with: ..Range("A1:L" & CStr(Rownum - 1)).Sort Key1:=Range("K2"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom But it won't work. Any suggestions?? Peter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Have the need to sort text code-values within same Excel cell | Excel Worksheet Functions | |||
excel date scheduling not msProject | Excel Worksheet Functions | |||
Linking Data from MSProject to Excel | Excel Discussion (Misc queries) | |||
Hyperlink from MSProject to Excel? | Excel Discussion (Misc queries) | |||
Zip code sort is an Excel problem even when using the special cat. | Excel Discussion (Misc queries) |