Programming excel with VBA and NET (2006)

2,096 10 0
  • Loading ...
1/2,096 trang
Tải xuống

Thông tin tài liệu

Ngày đăng: 25/03/2019, 16:04

ProgrammingExcelwithVBAand NET BySteveSaunders,JeffWebb Publisher:O'Reilly PubDate:April2006 PrintISBN-10:0-596-00766-3 PrintISBN-13:978-0-59-600766-9 Pages:1114 TableofContents |Index WhyprogramExcel?Forsolvingcomplexcalculationsandpresentingresults,Excelis amazinglycompletewitheveryimaginablefeaturealreadyinplace Butprogramming Excelisn'taboutaddingnewfeaturesasmuchasit'saboutcombiningexistingfeaturesto solveparticularproblems Withafewmodifications,youcantransformExcelintoataskspecificpieceofsoftwarethatwillquicklyandpreciselyserveyourneeds Inotherwords, Excelisanidealplatformforprobablymillionsofsmallspreadsheet-basedsoftware solutions Thebestpartis,youcanprogramExcelwithnoadditionaltools AvariantoftheVisual Basicprogramminglanguage,VBforApplications(VBA)isbuiltintoExceltofacilitateits useasaplatform WithVBA,youcancreatemacrosandtemplates,manipulateuser interfacefeaturessuchasmenusandtoolbars,andworkwithcustomuserformsordialog boxes VBAisrelativelyeasytouse,butifyou'veneverprogrammedbefore,Programming ExcelwithVBAand NETisagreatwaytolearnalotveryquickly Ifyou'reanexperienced ExceluseroraVisualBasicprogrammer,you'llpickupalotofvaluablenewtricks Developerslookingforwardto NETdevelopmentwillalsofinddiscussionofhowtheExcel objectmodelworkswith NETtools,includingVisualStudioToolsforOffice(VSTO) ThisbookteachesyouhowtouseExcelVBAbyexplainingconceptsclearlyandconcisely inplainEnglish,andprovidesplentyofdownloadablesamplessoyoucanlearnbydoing You'llbeexposedtoawiderangeoftasksmostcommonlyperformedwithExcel,arranged intochaptersaccordingtosubject,withthosesubjectscorrespondingtooneormoreExcel objects Withboththesamplesandimportantreferenceinformationforeachobject includedrightinthechapters,insteadoftuckedawayinseparatesections,Programming ExcelwithVBAand NETcoverstheentireExcelobjectlibrary Forthosejuststartingout, italsolaysdownthebasicrulescommontoallprogramminglanguages Withthissingle-sourcereferenceandhow-toguide,you'lllearntousethecompleterange ofExcelprogrammingtaskstosolveproblems,nomatterwhatyou'reexperiencelevel ProgrammingExcelwithVBAand NET BySteveSaunders,JeffWebb Publisher:O'Reilly PubDate:April2006 PrintISBN-10:0-596-00766-3 PrintISBN-13:978-0-59-600766-9 Pages:1114 TableofContents |Index ProgrammingExcelwithVBAand NET Preface PartI: LearningVBA Chapter1 BecominganExcelProgrammer Section1.1 WhyProgram? Section1.2 RecordandReadCode Section1.3 ChangeRecordedCode Section1.4 FixMisteakes Section1.5 StartandStop Section1.6 ViewResults Section1.7 Where'sMyCode? Section1.8 MacrosandSecurity Section1.9 WriteBug-FreeCode Section1.10 NavigateSamplesandHelp Section1.11 WhatYou'veLearned Chapter2 KnowingtheBasics Section2.1 PartsofaProgram Section2.2 ClassesandModules Section2.3 Procedures Section2.4 Variables Section2.5 ConditionalStatements Section2.6 Loops Section2.7 Expressions Section2.8 Exceptions Section2.9 WhatYou'veLearned Chapter3 TasksinVisualBasic Section3.1 TypesofTasks Section3.2 InteractwithUsers Section3.3 DoMath Section3.4 WorkwithText Section3.5 GetDatesandTimes Section3.6 ReadandWriteFiles Section3.7 CheckResults Section3.8 FindTruth Section3.9 CompareBits Section3.10 RunOtherApplications Section3.11 ControltheCompiler Section3.12 NotCoveredHere Section3.13 WhatYou'veLearned Chapter4 UsingExcelObjects Section4.1 ObjectsandTheirMembers Section4.2 GetExcelObjects Section4.3 GetObjectsfromCollections Section4.4 AboutMeandtheActiveObject Section4.5 FindtheRightObject Section4.6 CommonMembers Section4.7 RespondtoEventsinExcel Section4.8 TheGlobalObject Section4.9 TheWorksheetFunctionObject Section4.10 WhatYou'veLearned Chapter5 CreatingYourOwnObjects Section5.1 ModulesVersusClasses Section5.2 AddMethods Section5.3 CreateProperties Section5.4 DefineEnumerations Section5.5 RaiseEvents Section5.6 CollectObjects Section5.7 ExposeObjects Section5.8 DestroyObjects Section5.9 ThingsYouCan'tDo Section5.10 WhatYou'veLearned Chapter6 WritingCodeforUsebyOthers Section6.1 TypesofApplications Section6.2 TheDevelopmentProcess Section6.3 DetermineRequirements Section6.4 Design Section6.5 ImplementandTest Section6.6 Integrate Section6.7 TestPlatforms Section6.8 Document Section6.9 Deploy Section6.10 WhatYou'veLearned Section6.11 Resources PartII: ExcelObjects Chapter7 ControllingExcel Section7.1 PerformTasks Section7.2 ControlExcelOptions Section7.3 GetReferences Section7.4 ApplicationMembers Section7.5 AutoCorrectMembers Section7.6 AutoRecoverMembers Section7.7 ErrorCheckingMembers Section7.8 SpellingOptionsMembers Section7.9 WindowandWindowsMembers Section7.10 PaneandPanesMembers Chapter8 Opening,Saving,andSharingWorkbooks Section8.1 Add,Open,Save,andClose Section8.2 ShareWorkbooks Section8.3 ProgramwithSharedWorkbooks Section8.4 ProgramwithSharedWorkspaces Section8.5 RespondtoActions Section8.6 WorkbookandWorkbooksMembers Section8.7 RecentFileandRecentFilesMembers Chapter9 WorkingwithWorksheetsandRanges Section9.1 WorkwithWorksheetObjects Section9.2 WorksheetsandWorksheetMembers Section9.3 SheetsMembers Section9.4 WorkwithOutlines Section9.5 OutlineMembers Section9.6 WorkwithRanges Section9.7 RangeMembers Section9.8 WorkwithScenarioObjects Section9.9 ScenarioandScenariosMembers Section9.10 Resources Chapter10 LinkingandEmbedding Section10.1 AddComments Section10.2 UseHyperlinks Section10.3 LinkandEmbedObjects Section10.4 Speak Section10.5 CommentandCommentsMembers Section10.6 HyperlinkandHyperlinksMembers Section10.7 OleObjectandOleObjectsMembers Section10.8 OLEFormatMembers Section10.9 SpeechMembers Section10.10 UsedObjectsMembers Chapter11 PrintingandPublishing Section11.1 PrintandPreview Section11.2 ControlPaging Section11.3 ChangePrinterSettings Section11.4 FilterRanges Section11.5 SaveandDisplayViews Section11.6 PublishtotheWeb Section11.7 AutoFilterMembers Section11.8 FilterandFiltersMembers Section11.9 CustomViewandCustomViewsMembers Section11.10 HPageBreak,HPageBreaks,VPageBreak,VPageBreaks Members Section11.11 PageSetupMembers Section11.12 GraphicMembers Section11.13 PublishObjectandPublishObjectsMembers Section11.14 WebOptionsandDefaultWebOptionsMembers Chapter12 LoadingandManipulatingData Section12.1 WorkingwithQueryTableObjects Section12.2 QueryTableandQueryTablesMembers Section12.3 WorkingwithParameterObjects Section12.4 ParameterMembers Section12.5 WorkingwithADOandDAO Section12.6 ADOObjectsandMembers Section12.7 DAOObjectsandMembers Section12.8 DAO.DatabaseandDAO.DatabasesMembers Section12.9 DAO.DocumentandDAO.DocumentsMembers Section12.10 DAO.QueryDefandDAO.QueryDefsMembers Section12.11 DAO.RecordsetandDAO.RecordsetsMembers Chapter13 AnalyzingDatawithPivotTables Section13.1 QuickGuidetoPivotTables Section13.2 ProgramPivotTables Section13.3 PivotTableandPivotTablesMembers Section13.4 PivotCacheandPivotCachesMembers Section13.5 PivotFieldandPivotFieldsMembers Section13.6 CalculatedFieldsMembers Section13.7 CalculatedItemsMembers Section13.8 PivotCellMembers Section13.9 PivotFormulaandPivotFormulasMembers Section13.10 PivotItemandPivotItemsMembers Section13.11 PivotItemListMembers Section13.12 PivotLayoutMembers Section13.13 CubeFieldandCubeFieldsMembers Section13.14 CalculatedMemberandCalculatedMembersMembers Chapter14 SharingDataUsingLists Section14.1 UseLists Section14.2 ListObjectandListObjectsMembers Section14.3 ListRowandListRowsMembers Section14.4 ListColumnandListColumnsMembers Section14.5 ListDataFormatMembers Section14.6 UsetheListsWebService Section14.7 ListsWebServiceMembers Section14.8 Resources Chapter15 WorkingwithXML Section15.1 UnderstandXML Section15.2 SaveWorkbooksasXML Section15.3 UseXMLMaps Section15.4 ProgramwithXMLMaps Section15.5 XmlMapandXmlMapsMembers Section15.6 XmlDataBindingMembers Section15.7 XmlNamespaceandXmlNamespacesMembers Section15.8 XmlSchemaandXmlSchemasMembers Section15.9 GetanXMLMapfromaListorRange Section15.10 XPathMembers Section15.11 Resources Chapter16 Charting Section16.1 NavigateChartObjects Section16.2 CreateChartsQuickly Section16.3 EmbedCharts Section16.4 CreateMoreComplexCharts Section16.5 ChooseChartType Section16.6 CreateComboCharts Section16.7 AddTitlesandLabels Section16.8 PlotaSeries Section16.9 RespondtoChartEvents Section16.10 ChartandChartsMembers Section16.11 ChartObjectandChartObjectsMembers Section16.12 ChartGroupandChartGroupsMembers Section16.13 SeriesLinesMembers Section16.14 AxesandAxisMembers Section16.15 DataTableMembers Section16.16 SeriesandSeriesCollectionMembers Section16.17 PointandPointsMembers Chapter17 FormattingCharts Section17.1 FormatTitlesandLabels Section17.2 ChangeBackgroundsandFonts Section17.3 AddTrendlines Section17.4 AddSeriesLinesandBars Section17.5 ChartTitle,AxisTitle,andDisplayUnitLabelMembers Section17.6 DataLabelandDataLabelsMembers Section17.7 LeaderLinesMembers Section17.8 ChartAreaMembers Section17.9 ChartFillFormatMembers Section17.10 ChartColorFormatMembers Section17.11 DropLinesandHiLoLinesMembers Section17.12 DownBarsandUpBarsMembers Section17.13 ErrorBarsMembers Section17.14 LegendMembers Section17.15 LegendEntryandLegendEntriesMembers Section17.16 LegendKeyMembers Section17.17 GridlinesMembers Section17.18 TickLabelsMembers Section17.19 TrendlineandTrendlinesMembers Section17.20 PlotAreaMembers Section17.21 FloorMembers Section17.22 WallsMembers Section17.23 CornersMembers Chapter18 DrawingGraphics Section18.1 DrawinExcel Section18.2 CreateDiagrams Section18.3 ProgramwithDrawingObjects Section18.4 ProgramDiagrams Section18.5 Shape,ShapeRange,andShapesMembers Section18.6 AdjustmentsMembers Section18.7 CalloutFormatMembers Section18.8 ColorFormatMembers Section18.9 ConnectorFormatMembers Section18.10 ControlFormatMembers Section18.11 FillFormatMembers Section18.12 FreeFormBuilder Section18.13 GroupShapesMembers Section18.14 LineFormatMembers Section18.15 LinkFormatMembers Section18.16 PictureFormatMembers Section18.17 ShadowFormat Section18.18 ShapeNodeandShapeNodesMembers Section18.19 TextFrame Section18.20 TextEffectFormat Section18.21 ThreeDFormat Chapter19 AddingMenusandToolbars Section19.1 AboutExcelMenus Section19.2 BuildaTop-LevelMenu Section19.3 CreateaMenuinCode Section19.4 BuildContextMenus Section19.5 BuildaToolbar Section19.6 CreateToolbarsinCode Section19.7 CommandBarandCommandBarsMembers Section19.8 CommandBarControlandCommandBarControlsMembers Section19.9 CommandBarButtonMembers Section19.10 CommandBarComboBoxMembers Section19.11 CommandBarPopupMembers Chapter20 BuildingDialogBoxes Section20.1 TypesofDialogs Section20.2 CreateData-EntryForms Section20.3 DesignYourOwnForms Section20.4 UseControlsonWorksheets Section20.5 UserFormandFrameMembers Section20.6 ControlandControlsMembers Section20.7 FontMembers Section20.8 CheckBox,OptionButton,ToggleButtonMembers Section20.9 ComboBoxMembers Section20.10 CommandButtonMembers Section20.11 ImageMembers Section20.12 LabelMembers Section20.13 ListBoxMembers Section20.14 MultiPageMembers Section20.15 PageMembers Section20.16 ScrollBarandSpinButtonMembers Section20.17 TabStripMembers Section20.18 TextBoxandRefEditMembers Chapter21 SendingandReceivingWorkbooks Section21.1 SendMail Section21.2 WorkwithMailItems Section21.3 CollectReviewComments Section21.4 RouteWorkbooks Section21.5 ReadMail Section21.6 MsoEnvelopeMembers Section21.7 MailItemMembers Section21.8 RoutingSlipMembers PartIII: ExtendingExcel Chapter22 BuildingAdd-ins Section22.1 TypesofAdd-ins Section22.2 Code-OnlyAdd-ins Section22.3 VisualAdd-ins Section22.4 SetAdd-inProperties Section22.5 SigntheAdd-in Section22.6 DistributetheAdd-in Section22.7 WorkwithAdd-insinCode Section22.8 AddInandAddInsMembers webservices2nd callingasynchronously locatingontheInternet reformattingXMLresultsforExcel usingthroughXML WebServicesToolkit WebServicesToolkit2nd3rd onlineinformation using WebConsecutiveDelimitersAsOne(QueryTable) WebDisableDateRecognition(QueryTable) WebDisableRedirections(QueryTable) WebFormattingproperty(QueryTable) WebOptionsmethod(Workbook) WebOptionsobject,members WebPreFormattedTextToColumns(QueryTable) WebSelectionType(QueryTable) WebSelectionTypeproperty WebSingleBlockTextImport(QueryTable) WebTablesproperty WebTablesproperty(QueryTable) Weekdayfunction Whilestatement,usinginDo Loop While Wendstatement whitespace,removingfromstrings width defaultcolumnwidth settingforcolumnsinrange usableareaofExcel Width#function Widthmethod(Application) Widthproperty Win32API WIN32API.TXTfile Windowobject Activatemethods2nd Closemethod closingandmaximizingchildwindows members2nd PrintOutandPrintPreviewmethods windows panes settingproceduretorunuponactivation WindowsAPI functions usinghandleswith Windowscollection Arrangemethod CompareSideBySideWithmethod members SyncScrollingSideBySideproperty WindowsCommonObjectModel(COM) Windowsmethod Applicationobject Workbookobject WindowsNTandearlier,installlocationsforapplications WindowsServer2003 Windowstaskbar WindowsTaskManager WindowsForPens(Application) WindowStatemethod(Application) WindowStatemethod(Window) WindowStateproperty(Application) WinExecfunction WinZipself-extractor URLfordownloads WinZiptool URLfordownloads Withkeyword WithEvents(Workbookvariable) WithEventskeyword declaring NETobjectwith2nd Word automationfromVisualBasic Diagramobject exceptions,anticipatingfromExcel integratingwithExcel objectlibrary,referencingfromExcel programmingfromExcel runningfromExcel Word2003,openingXMLspreadsheet Worddocument embeddedontheactiveworksheet gettingobjectfromembeddeddocument WordArtembeddedshapes2nd3rd text WordWrapproperty(TextBox,RefEdit) workbook(.xls)file VisualBasiccodein Workbookobject Activatemethod BeforePrintevent CanCheckOutproperty Chartsproperty CustomViewsproperty events2nd declaringinanyclass SheetSelectionChange FollowHyperlinkmethod gettingPublishObjectscollectionfrom members(key),referencesummary members,listed objectandeventlists passwordandencryptionmembers PivotCachecollection PrintOutandPrintPreviewmethods protectionmembers returningforfilecontainingcurrentprocedure RoutingSlipproperty Savemethod SaveAsmethod SharedWorkspaceproperty SheetActivateevent XmlNamespacesmethod workbooks accessingandrespondingtoevents advantages/disadvantagesofapplications applications,writing bringingdatainto closing creatinghardcopyandonlineoutputfrom creatingtestworkbookforadd-in installing loading,predefinedfoldersfor objects openingtextfilesas openingXMLfiles opening,saving,andcontrollingfiles addingworkbookwithtemplates openingasread-onlyorwithpasswords openingtextfiles recalculatingbeforesaving savingbeforequitting security encryption passwordprotectionandencryption protectingitems sendingandreceiving workbooks(continued) sendingasemailattachment mailitems routing SendForReviewmethod settingpermissions shared,programmingwith changingsharingoptions determiningifshared removingsharing resolvingconflicts restrictinguseraccess sharing creatingsharedworkbook creatingsharedworkspace sharedworkspaces Workbookscollection Addmethod2nd Applicationobject gettingfromApplicationobject,Workbooksproperty members,listed Openmethod OpenDatabasemethod OpenTextmethod OpenXMLmethod Workbooksmethod(Application) worksheetmenubar addingtop-levelmenu Worksheetmethod(Range) Worksheetobject2nd Activateevent Activatemethod AutoFiltermember AutoFilterproperty Cells,Range,UsedRange,Columns,orRowsmethod ChartObjectsproperty Commentscollection CreatePivotTableWizardmethod events Hyperlinksmethod MailEnvelopeproperty members(key),referencesummary members,listed objectandeventlists OLEObjectsmethod Outlineproperty2nd PageSettingsproperty PageSetupproperty PrintOutandPrintPreviewmethods protectionmembers QuertyTablesproperty Scenariosmethod SelectionChangeevent ShowAllDatamethod WorksheetFunctionmethod(Application) WorksheetFunctionobject members worksheets addingcomments,hyperlinksandOLEobjectsto changeson,listing controlsonworksheetsversuscontrolsonforms creatinggraphics,objectsusedfor embeddingacontrol events numberautomaticallyincludedinnewworkbooks printsettings repeatingformattingandchartinginrecordedcode security securityprotections sendingasemailusingMsoEnvelope usingcontrolson workingwith,objectsfor2nd Worksheetscollection2nd3rd Addmethod Applicationobject members,listed PrintOutandPrintPreviewmethods UseWorksheetsmethod Worksheetsmethod objectsreturnedby Workbookobject2nd workspacefiles(.xlw) savingcurrentsettings sharedworkspacesversus workspaces shared2nd creating linkingworkbookto openingworkbooksfrom removingsharingfromworkbooks WrapTextproperty(Range) Write#function write-onceproperties2nd write-onlyproperties creating WritePassword(Workbook) WriteReserved(Workbook) WriteReservedBy(Workbook) WScript.Shell URLfor WSDL(WebServiceDescriptionLanguage) Index [SYMBOL][A][B][C][D][E][F][G][H][I][J][K][L][M][N] [O][P][Q][R][S][T][U][V][W][X][Y][Z] XLL,loadingandregistering XLSTARTdirectory,pathto XML customschemas,supportof exportingworkbooktoXMLdatafile importing/exporting,objectsfor languagestandards listsstoredas loadingfileintoworkbook objects forimporting/exporting onlineresources openingfilesinExcel overview reformattingforExcel respondingtoXMLevents savingworkbooksas dataomittedbyExcel spreadsheetformat transformingfromcommandline transformingincode transformingwithprocessinginstructions transformingXMLfilesintospreadsheets transformingXMLspreadsheets XSLT,creatingforXMLspreadsheets Sourcetaskpane,displaying supportbyExcel2003 supportingstandardsfor usingwebservicesthrough XMLmaps approachestousing avoidingdenormalizeddata creatingXMLschema includingallnodesinexports XMLschemaelementsnotsupported exportingdata itemsomittedbyExcel gettingfromlistorrange limitationsof programmingwith addingordeletingXMLmaps exporting/importingXML refresh,change,orcleardatabinding viewingtheschema usingschemas XMLmethod(XmlSchema) xml-stylesheetprocessinginstruction XmlDataBindingobject LoadSettingsmethod Refreshmethod RootElementNamespacemethod XmlImportmethod(Workbook) XmlImportXmlmethod(Workbook) XmlMapobject Deletemethod Exportmethod Importmethod IsExportableproperty members Schemasmethod tasksperformedincode XMLMapproperty(ListObject) XmlMapscollection Addmethod members XMLMapsmethod(Workbook) XMLNamespaceobject XmlNamespacescollection XmlNamespacesmethod(Workbook)2nd XMLNodeListarguments XmlSchemaobject,members XmlSchemascollection,members XORoperator XPath XPathmethod(ListColumn) XPathobject members XSD(XMLSchemaDefinition) onlinetutorial XSL onlineresources xsl:processing-instructionelement XSLT creatingforXMLspreadsheet onlinetutorial XSLT(continued) replacingmso-applicationinstructionwithxml-stylesheet instruction transformationsperformedby XValuesproperty(Series) XYGroupsmethod(Chart) Index [SYMBOL][A][B][C][D][E][F][G][H][I][J][K][L][M][N] [O][P][Q][R][S][T][U][V][W][X][Y][Z] Yearfunction Index [SYMBOL][A][B][C][D][E][F][G][H][I][J][K][L][M][N] [O][P][Q][R][S][T][U][V][W][X][Y][Z] zerovalues,displayingincells Zoomproperty PageSetupobject UserFormobject Windowobject ZOrderproperty Controlobject OLEObjectobject ... executewebservicestoperformtasksremotelyacrossa network Chapter25, Programming Excel with NET, teacheshowto use NET codefromwithin Excel, use Excel codefrom NET, orintegratebetween Excel and NET usingVisualStudio... NutshellHandbook,theNutshellHandbooklogo, and the O'ReillylogoareregisteredtrademarksofO'ReillyMedia,Inc Programming Excel with VBA and NET, theimageofashoveler duck, and relatedtradedressaretrademarksofO'ReillyMedia,... Programming Excel with VBA and NET Preface PartI: Learning VBA Chapter1 Becomingan Excel Programmer Section1.1 WhyProgram? Section1.2 Record and ReadCode Section1.3
- Xem thêm -

Xem thêm: Programming excel with VBA and NET (2006) , Programming excel with VBA and NET (2006) , Chapter 1. Becoming an Excel Programmer, Chapter 3. Tasks in Visual Basic, Chapter 5. Creating Your Own Objects, Chapter 6. Writing Code for Use by Others, Chapter 8. Opening, Saving, and Sharing Workbooks, Chapter 9. Working with Worksheets and Ranges, Chapter 12. Loading and Manipulating Data, Chapter 13. Analyzing Data with Pivot Tables, Chapter 14. Sharing Data Using Lists, Chapter 19. Adding Menus and Toolbars, Chapter 21. Sending and Receiving Workbooks, Chapter 23. Integrating DLLs and COM, Chapter 24. Getting Data from the Web, Chapter 25. Programming Excel with .NET, Chapter 26. Exploring Security in Depth

Mục lục

Xem thêm

Gợi ý tài liệu liên quan cho bạn