Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
PivotTables AddDataField
I'm trying to add a pivot table field using VB Office Tools (I have VB 2007
and Office 2007). In VBA, the command is ActiveSheet.PivotTables("PivotTable1").AddDataFiel d ActiveSheet.PivotTables("PivotTable1").PivotFields ("r3 Ret"), "r3 Ret ", xlAverage In VB, I can't figure out the equivalent constant for 'xlAverage'. I've tried using Help but it doesn't describe this very well. What is the equivalent of VBA's xlAverage in VB? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
PivotTables AddDataField
Hello Ed,
In VB.NET (I assume that you meant VB.NET in VS 2008 by "VB2007"), the equivalent to xlAverage of VBA is Microsoft.Office.Interop.Excel.XlConsolidationFunc tion.xlAverage In case that you meet with similar problems again, here is a tip to find out the equivalent to VBA: In VBA project editor of Excel, we right click on the constant "xlAverage", and choose "Object Browser". In the "Object Browser" window, we input xlAverage in the search textbox and press the search button. The "Search Results" box will list the hits of xlAverage: Library Class Member Excel XlConsolidationFunction xlAverage In this way, we will know where the constant is defined: XlConsolidationFunction. Then in VB.NET, the .NET intelligence can help us quickly locate the class XlConsolidationFunction and find out the constant: Microsoft.Office.Interop.Excel.XlConsolidationFunc tion.xlAverage. Please let me know if you have any other concerns, or need anything else. Regards, Jialiang Ge , remove 'online.') Microsoft Online Community Support Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: . ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscripti...ult.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscripti...t/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
PivotTables AddDataField
Yes, I meant VS 2008.
That is what I was looking for. Thanks for letting me know how to find other constants. I've always found it frustrating trying to convert a macro recorded in VBA into VB.Net, especially because the constants are frequently different. While there is some limited intellisense in VS Office Tools, it is quite limited. Ed ""Jialiang Ge [MSFT]"" wrote in message .. . Hello Ed, In VB.NET (I assume that you meant VB.NET in VS 2008 by "VB2007"), the equivalent to xlAverage of VBA is Microsoft.Office.Interop.Excel.XlConsolidationFunc tion.xlAverage In case that you meet with similar problems again, here is a tip to find out the equivalent to VBA: In VBA project editor of Excel, we right click on the constant "xlAverage", and choose "Object Browser". In the "Object Browser" window, we input xlAverage in the search textbox and press the search button. The "Search Results" box will list the hits of xlAverage: Library Class Member Excel XlConsolidationFunction xlAverage In this way, we will know where the constant is defined: XlConsolidationFunction. Then in VB.NET, the .NET intelligence can help us quickly locate the class XlConsolidationFunction and find out the constant: Microsoft.Office.Interop.Excel.XlConsolidationFunc tion.xlAverage. Please let me know if you have any other concerns, or need anything else. Regards, Jialiang Ge , remove 'online.') Microsoft Online Community Support Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: . ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscripti...ult.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscripti...t/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PivotTables.AddDataField | Excel Programming | |||
PivotTables | Excel Discussion (Misc queries) | |||
.AddDataField: is there a similar "replace" data field? | Excel Programming | |||
New to Pivottables- need help | Charts and Charting in Excel | |||
PivotTable: AddDataField method | Excel Programming |