Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
AAAHHHhhh!!!
So simple!! (It worked) Thanks Tom. -----Original Message----- try putting a period/full stop in front of the Range("K2") Key1:=.Range("K2"), perhaps project has a range object. Also, do you have a reference set to the excel object library? If not, all your constant values are essentially undefined/uninitialized variables with a interpretation being a value of zero. You would need to put in the appropriate numbers or create the reference. -- Regards, Tom Ogilvy Peter Darmody wrote in message ... 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) |