Set excelApp =vba getobjectt(, "Excel.Application")与Set excelApp = CreateObject

文档分类:
在线文档经过高度压缩,下载原文更清晰。
淘豆网网友近日为您收集整理了关于Integrating Ms Excel And Access With Autocad Vba的文档,希望对您的工作和学习有所帮助。以下是文档介绍:Integrating Ms Excel And Access With Autocad Vba Las Vegas, NevadaNovember 28 – December 1Speaker Name: dave espinosa-aguilarCourse: Integrating Microsoft Excel and Access with AutoCAD VBACourse Description: For years AutoCAD users have been trying to learn how to integratethe power of Excel spreadsheets and Access databases with AutoCAD drawings. This courseintroduces intermediate and advanced AutoCAD users to the programming concepts requiredto link and maintain the integration of these three (来源:淘豆网[/p-2524099.html])products through Visual Basic. Examples ofcode to generate bills of materials, block counts and facilities management applications will bediscussed in depth.Integrating Microsoft Excel and Access with AutoCAD VBAHi, my name is dave espinosa-aguilar. I’ve been using and training folks on AutoCAD since the mid1980's, I visit about panies a year, and I get to see how people throughout the country useAutoCAD in powerful and clever ways. It's an interest(来源:淘豆网[/p-2524099.html])ing fact that most AutoCAD users haveMicrosoft Office installed on their systems these days, and applications like Microsoft Excel andMicrosoft Access lend tremendous resources to extending the capabilities of AutoCAD, especiallynow that the AutoCAD's VBA interface is &fully cooked.&This class is not an introduction to AutoCAD, Excel, Access or VBA. Several classes at this year'sAutodesk University treat the subject of introductory VBA pro(来源:淘豆网[/p-2524099.html])gramming in AutoCAD, and this coursemakes no attempt to plish that in addition to discussing all the concepts involved in integratingAutoCAD, Excel and Access. The sole purpose of this course is to build on existing knowledge ofthese applications and interfaces so that AutoCAD can exploit Microsoft Office spreadsheet anddatabase functionality. These notes may fast e an AutoCAD VBA &bible& on this subject.What does Microsoft Excel Offer an (来源:淘豆网[/p-2524099.html])AutoCAD User?If you've ever done a manual count of blocks or block attribute values, if you've ever had to generatea manual schedule of ponents or a report of entitiy counts in a CAD drawing, you mightalready be able to appreciate the benefit of a spreadsheet application which can automate thisprocess for you. Through AutoCAD's programming interfaces, tallies of AutoCAD entities and theirvalues can be generated quickly to save time and make valuable(来源:淘豆网[/p-2524099.html]) information available to otherapplications.Consider the typical strengths of a spreadsheet: the ability anize data, thethe ability to process data, the ability to query data and treat ranges of data, theability to work with data types and best of all, pass that information in a gridformat to other applications. This class is all about how to bring the power of aspreadsheet application right into AutoCAD drawings. Let's examine typicallimitations of(来源:淘豆网[/p-2524099.html]) AutoCAD TEXT entities and how a spreadsheet application cancircumvent them. Consider the figure to the left. Suppose this small schedulewas drawn strictly using AutoCAD entities (TEXT and LINE entities) to reportthe counts for 5 different block types named ITEM1 through ITEM5.1. These numbers would have to be initially generated by manual counts since there are nofunctions in vanilla AutoCAD which will put together custom schedules like this.2. If (来源:淘豆网[/p-2524099.html])new blocks are added to the drawing, the schedule would have to be updated manually sincethere is no relationship between the TEXT entities and the blocks.3. To get a total for all items, you would have to do a manual calculation (you can't add TEXT entitiesin AutoCAD). Maybe adding up five numbers isn't a problem, but imagine adding up 20, or 100, or1000 items. Imagine trying to keep track of hundreds of item types as any design size increases.In s(来源:淘豆网[/p-2524099.html])hort, by using VBA with a spreadsheet application like Excel, not only can these counts beautomated as new items get added to the drawing, but the counts are fast, accurate, and a total canbe automatically generated. Add to these benefits the fact that it is easier to stretch the size of anOLE-pasted grid object than it is to redefine text styles, the fact that it is easier to insert a new row ornew column to a grid object than it is to move existin(来源:淘豆网[/p-2524099.html])g text entities around to odate new rowsand columns, and add the fact that this schedule information can be shared with other applicationslike word processors and databases--- and you have some pretty convincing arguments forexamining the integration of Microsoft Excel with AutoCAD.3And VBA makes this all possible so that you can easily generate bill of materials, schedules, reports,and share all this information with other Windows applications. Not(来源:淘豆网[/p-2524099.html]) only can information fromAutoCAD be tallied, but it can also be numerically processed (sums, averages, minimums maximums,etc) And since Excel is OLE-capable, you can drop-and-drag your integrated worksheets right backinto AutoCAD as stretchable, linked (aka re-editable), evenly-spaced plot-able entities untothemselves.What does Microsoft Access Offer an AutoCAD User?The information in many types of CAD drawings essentially reduces to a vast database of numeric,financial, and textual information. Consider for example a drawing which might have thousands ofpoint entities reflecting survey location and elevation data, or a landscaping plan filled with hundredsof plant types that each have field data associated with them (plant type, age of plant, waterrequirement, plant nursery source, plant cost, etc), or an architectural design which has cost andmanufacturer information associated with materials, parts and details. In many cases, much of thisinformation is non-associated with CAD entities and it can be a time-consuming (read expensive)process not only keeping tabs on all of it, but working with it.There are also many entities in AutoCAD which can hold data (suchas Block attributes) but which are extrememly limited in theircapacity to be updated, queried, processed, exported to other dataformats and shared with other Windows applications. The figure tothe left shows six insertions of a block with two attributes. hat your design has hundreds of blocks like this in it, and hundredsof other block definitions in it as well, each with a unique set ofattribute values. There are some limited ways to &pull& informationfrom these blocks and export it to a text file (using templates with mand), but:1. You could not add up the total number of blocks that have &chair& for their first attribute value sinceall six of these blocks are named the same.2. You could not add up the total (nor take the average value, nor find the minimum or maximumvalue) of the second attribute value in those blocks which have &seat& for their first attribute value.3. You could not replace the values of the second attribute of those blocks which have &chair& fortheir first attribute value.4. You could not create a selection set or change the properties of those blocks based on an SQL-type query for a visual understanding of the data.And that's a huge benefit of databases: that they can be queried numerically, financially, by date, bystring matches, etc. If the values you are storing in block attributes need to be examined, processed,tallied, manipulated, etc, you have few if any options within AutoCAD to do this, and these are justsome of the typical limitations in AutoCAD that a database can e.Note: DBCONNECT, ASE and other database technologies internal to AutoCAD do make it possibleto not only link AutoCAD entities with databases, but to query them, select them, change them andtally them etc.But in all fairness (as anyone who has ever used them will tell you), these tools are severely limited intheir capacity to analyze entities, generate reports, import/export data and mass-process field valuesinternal to AutoCAD entities. The required linking interface alone (manually selecting entities to linkthem with database records) can be a prohibitive process. VBA makes it possible for databaserecords to be linked with AutoCAD entities based on their existing properties and attribute values.4Yet another extrememly beneficial use of external databases with AutoCAD is that they keepAutoCAD sessions fast. When you rely on database information to be stored in AutoCAD, it slowsAutoCAD down (the bigger the drawing, the slower it processes). By externalizing data and linking itwith entities in AutoCAD, you not only gain full database functionality over that information, but yousignificantly reduce the drawing size. For example, if you had a series of blocks that represented treetypes, each block containing up to 20 fields of unique data, and you needed to change the values ofcertain fields for certain types of trees, you would have to manually edit the data in blocks (everchange over 20 attribute values in a block manually?) which is time consuming and downrightmundane. But if this data were in a database, it would be easy to create an index of those recordswhich met your criteria and change their field values in seconds. By each CAD tree symbol beinglinked to a record rather than containing data within itself, you gain database functionality over yourCAD drawing entities and the information associated with them. You also wind up with faster CADdrawings to work with.Finally, like spreadsheets, databases understand data types. They know the difference between anumeric (integer, real, etc) value and a dollar value and a textual value and a date value and theyknow how to store these value types efficiently. Block attributes see every data value as a textualvalue no matter what it represents to you, and this is why block attributes can't be numericallyprocessed or queried effectively. When you explode a block with attribute values (using ExpressTools or other tools which retain the attribute values), you wind up with TEXT entities which have thesame limitations as discussed in the Excel example above. To streamline your storage of data andkeep AutoCAD sessions fast, to gain full control over data that you associate with CAD entities, andto query and manipulate huge amounts of data and the CAD entities it is associated with, quickly, anexternal database is often the best alternative.Essential Preparations for Connecting AutoCAD with Excel and AccessObviously, to take advantage of AutoCAD's VBA, we need to launch AutoCAD and use mandlike VBAMAN or VBAIDE to bring up the VBA interface within AutoCAD. This class assumes youhave Excel and Access loaded on your system. By default, AutoCAD VBA does not recognize Exceland Access objects, so you need to use the VBA Tools/References pulldown menu function andselect a Microsoft Excel Object Library and/or a Microsoft DAO (Data Access Objects) Library to useExcel and/or Access Objects and their properties in your VBA code. Public variables and non-privatefunctions are used in the code examples for this class to keep things simple.AutoCAD VBA/Excel Coding ConceptsThe following General Declarations for treating the Excel Application and workbooks and worksheetswithin it are assumed for the code examples provided in this course:Public excelApp As ObjectPublic wkbObj As ObjectPublic shtObj As ObjectWhen working with any Microsoft Office application such as Excel, your VBA code must first establisha link with it. You cannot assume that a session of Excel is already running, so the code has plish several things: it has to detect if Excel is already running, if Excel is already running thenestablish a link with it, and if Excel isn't already running, launch a session of it. The GetObjectfunction assumes that Excel is already running. If it isn't, an error (non-zero condition) is generatedand we use the CreateObject function to launch Excel. If Excel cannot be launched for some reason,then another error is generated and we notify the user. If Excel can be launched, we add a workbook(which has 3 default sheets to it) and set the current worksheet to the first worksheet. A function torename the first sheet is also provided. The current workbook and worksheet pointers are also set.mandButton1_Click()5On Error Resume NextSet excelApp = GetObject(, &Excel.Application&)If Err && 0 ThenErr.ClearSet excelApp = CreateObject(&Excel.Application&)If Err && 0 ThenMsgBox &Could not start Excel&, vbExclamationEndEnd IfEnd IfexcelApp.Visible = TrueSet wbkObj = excelApp.Workbooks.AddSet shtObj = excelApp.Worksheets(1)End SubTo work with an existing spreadsheet file, you can use the code below to set the current workbook:Set wkbobj = Workbooks.Open(filename:=&c:\dir\filename.xls&)If the above code is assigned to mand button and the VBA code is run, pressing this button willeither launch Excel and link your VBA application to it, or link it to an existing session of Excel.The code below closes Excel, but a dialogmay ask if you want to save changes to thecurrent workbook.mandButton2_Click()excelApp.QuitEnd SubTo send a value from your VBA application to a particular cell in the linked Excel application, firstestablish which worksheet you're sending information too and then then set the worksheet cell valueby specifying the row and column using integer values. Be sure to use proper variable types whensetting the values of cells. In the code below, the first worksheet is specificed, and an integer, a realnumber and a string as passed to it. If you pull your values from textboxes and other object sources inyour forms, this is especially important.mandButton3_Click()Set shtObj = wkbObj.Worksheets(1)ival% = 1rval& = 1.5sval$ = &text&shtObj.Cells(1, 1).Value = ival%shtObj.Cells(2, 1).Value = rval&shtObj.Cells(3, 1).Value = sval$End SubNotice that the real value 1.5 passed to cell A2 in the spreadsheet reports as a value of 2. You canset the format of any cell in the spreadsheet by formatting the data you are passing to it from yourVBA application first.The code below shows how various types of formatted values from your VBA application appear inthe Excel spreadsheet once they are passed including system dates and times, system and dateformats, decimal precisions, and capitalization functions:mandButton4_Click()Set shtObj = wkbObj.Worksheets(1)Dim MyTime, MyDate, MyStr6MyTime = #5:04:23 PM#shtObj.Cells(1, 1).Value = MyTimeMyDate = #1/27/93#shtObj.Cells(2, 1).Value = MyDateMyStr = Format(Time, &Long Time&)shtObj.Cells(3, 1).Value = MyStrMyStr = Format(Date, &Long Date&)shtObj.Cells(4, 1).Value = MyStrMyStr = Format(MyTime, &h:m:s&)shtObj.Cells(5, 1).Value = MyStrMyStr = Format(MyTime, &hh:mm:ss AMPM&)shtObj.Cells(6, 1).Value = MyStrMyStr = Format(MyDate, &dddd, mmm d yyyy&)shtObj.Cells(7, 1).Value = MyStrMyStr = Format(23)shtObj.Cells(8, 1).Value = MyStrMyStr = Format(5459.4, &##,##0.00&)shtObj.Cells(9, 1).Value = MyStrMyStr = Format(334.9, &###0.00&)shtObj.Cells(10, 1).Value = MyStrMyStr = Format(5, &0.00%&)shtObj.Cells(11, 1).Value = MyStrMyStr = Format(334.9, &$###.##&)shtObj.Cells(12, 1).Value = MyStrMyStr = Format(&HELLO&, &&&)shtObj.Cells(13, 1).Value = MyStrMyStr = Format(&This is it&, &&&)shtObj.Cells(14, 1).Value = MyStrEnd SubFont name, size, bold or italics, and columnwidths can also be controlled from your VBA application:mandButton5_Click()Set shtObj = wkbObj.Worksheets(1)shtObj.Cells(1, 1) = &Hi there.&shtObj.Cells(1, 1).ColumnWidth = 30shtObj.Cells(1, 1).Font.Bold = TrueshtObj.Cells(1, 1).Font.Name = &Courier&shtObj.Cells(1, 1).Font.Size = 20shtObj.Cells(1, 1).JustifyshtObj.Cells(2, 1) = &Goodbye.&shtObj.Cells(2, 1).ColumnWidth = 20shtObj.Cells(2, 1).Font.Italic = TrueshtObj.Cells(2, 1).Font.Name = &Times Roman&shtObj.Cells(2, 1).Font.Size = 15shtObj.Cells(2, 1).JustifyshtObj.Cells(3, 1) = &Check&shtObj.Cells(3, 1).ColumnWidth = 5shtObj.Cells(3, 1).JustifyEnd SubYou can work with ranges and formulas in Excel from your VBA application as well:mandButton6_Click()With shtObj.Range(&A1:B2&).Font.Name = &Bookman Old Style&.Font.Size = 10.Font.Bold = True.Value = 4End WithRange(&A3&).Formula = &@average(A1:A2)&Range(&B3&).Formula = &@sum(B1:B2)&Range(&C3&).Formula = &=A3-B3&End SubYou can pull information from a cell into an object in your form. The codebelow shows how a value in a cell can be brought into a textbox object, orhow values found in a range of cells (A1:B4) can be brought into a bobox object (notice the use of the ColumnCount property is required for proper display ofcells involved in the imported range):mandButton7_Click()Textbox1.Text = Worksheets(&Sheet1&).Range(&A1&).boBox1.ColumnCount = 2ComboBox1.List = Worksheets(&Sheet1&).Range(&A1:B4&).ValueEnd SubAutoCAD VBA/Excel Sample Application #1: Block Counter/ScheduleGeneratorThe following code can be pasted into the General Declarations area. You can create the GUI belowby inserting a UserForm with mand buttons and 2 listboxes. Button1 cycles through all blocksfound in the drawing block collection and adds their names (except for those beginning with anasterisk) to Listbox1. It then cycles through all Listbox1 names, totaling all entities in Modelspacewhich are both blocks and named the current Listbox1 value to Listbox2. Button2 sends the Listboxdata to a new spreadsheet. Button3 exits the VBA application.Public excelApp As ObjectPublic wkbObj As ObjectPublic shtObj As mandButton1_Click()Dim i, j, btot As IntegerDim bnam As StringDim ent As Objectbtot = ThisDrawing.Blocks.CountFor i = 0 To btot - 1bnam = ThisDrawing.Blocks.Item(i).NameIf Not Mid$(bnam, 1, 1) = &*& Then ListBox1.AddItem bnamNext iFor i = 0 To ListBox1.ListCount - 1bnam = ListBox1.List(i): btot = 0For j = 0 To ThisDrawing.ModelSpace.Count - 1Set ent = ThisDrawing.ModelSpace.Item(j)If ent.EntityType = acBlockReference And ent.Name = bnam Then btot = btot + 1Next jListBox2.AddItem btotNext iEnd mandButton2_Click()On Error Resume NextSet excelApp = GetObject(, &Excel.Application&)If Err && 0 ThenErr.ClearSet excelApp = CreateObject(&Excel.Application&)If Err && 0 ThenMsgBox &Could not start Excel!&, vbExclamationEndEnd IfEnd IfexcelApp.Visible = TrueSet wkbObj = excelApp.Workbooks.AddSet shtObj = wkbObj.Worksheets(1)shtObj.Name = &Block Count&Dim i, j, btot As IntegerDim bnam As Stringj = 1For i = 0 To ListBox1.ListCount - 1bnam = ListBox1.List(i)btot = ListBox2.List(i)shtObj.Cells(j, 1).Value = bnamshtObj.Cells(j, 2).Value = btotj = j + 1Next i8End mandButton3_Click()EndEnd SubWith further VBA coding, you can plete control over which blocks get reported (such asthose with particular string wildcard values for their names, blocks with certain attribute tage names orattribute values that fall within numeric ranges,etc). You can also calculate totals, averages,minumum and maximum counts of blocks and values of block attributes in Excel, once the values arepassed to it or once you've sent formulas to certain cells which do it for you. You could even updateentities in AutoCAD according to cell values. Once you've generated a spreadsheet report of theblock counts, you can copy and paste cell ranges back into AutoCAD as a schedule report entitywhich can be stretched, replaced with new information, plotted/printed and manually updated.AutoCAD VBA/Excel Sample Application #2: Bill of MaterialsThe first sample application essentially shows how AutoCAD information can be passed to aspreadsheet so that a grid-like report (Schedule) can be pasted back into AutoCAD. In this secondapplication, entities which define areas are placed on layers with an associated cost per square inch.By pressing a single button, the user can know the overall cost of a design. Some standards areassumed. On the spreadsheet side of things, an existing spreadsheet with layer names and costsalready entered is assumed: its column A is assigned string values reflecting layer names, and itscolumn B is assigned real (dollar) values reflecting cost of material per square inch. For example, Thevalue of cell A1 might be &MATERIAL1& and the value of cell B1 might be $1.50. On the AutoCADside of things, only polylines are used to define areas on layers whose names match values incolumn A of the spreadsheet. If a new layer is defined in column A with a new cost of material incolumn B, area-defining entities can now be created on that new layer in AutoCAD and be added tothe overall cost when the routine is used. This application could easily be modified to associate blocknames with associated costs (instead of area-defining entities) to drive the numbers as well.You can create a GUI shown to the right by inserting a UserForm with mand buttons, 1 labeland 1 textbox. The routine opens the existing spreadsheet and loops through text values found incolumn A until it finds a blank cell and ends. For each non-blank cell it findsin Column A, it pulls the price value in column B. It then searches thedrawing database for polylines (EntityType 24) on the column A layer nameand multiplies each polyline entity area property with the column B value,adding this value to a total value for that layer. Each layer total is then addedto a grand total. In this way, no matter how many polylines of any shape aredrawn on layers represented with cost values in the spreadsheet, the pressof one button will yield the cost total for all areas according to their layerpricings. Now that's some serious estimating power!Public excelApp As ObjectPublic wkbObj As ObjectPublic shtObj As ObjectPrivate mandButton1_Click()On Error Resume NextSet excelApp = CreateObject(&Excel.Application&)If Err && 0 ThenErr.ClearMsgBox &Could not start Excel!&, vbExclamationEndEnd IfexcelApp.Visible = TrueSet wkbObj = Workbooks.Open(filename:=&c:\pricing\costing.xls&)Set shtObj = wkbObj.Worksheets(&Sheet1&)9Dim i, j As IntegerDim pnum, anum, atot As DoubleDim lnam, enam As StringDim ent As Objecti = 1: anum1 = 0#: anum2 = 0#: atot = 0#lnam = shtObj.Cells(i, 1).Valuepnum = shtObj.Cells(i, 2).ValueDo While Not (lnam = &&)For j = 0 To ThisDrawing.ModelSpace.Count - 1Set ent = ThisDrawing.ModelSpace.Item(j)If ent.EntityType = 24 And ent.Layer = lnam Thenanum1 = ent.Areaanum2 = anum2 + anum1End IfNext jatot = atot + (anum2 * pnum)anum1 = 0#: anum2 = 0#i = i + 1lnam = shtObj.Cells(i, 1).Valuepnum = shtObj.Cells(i, 2).ValueLoopexcelApp.QuitTextBox1.Text = atotEnd SubPrivate mandButton2_Click()EndEnd SubOther Things to Keep in Mind about Working with ExcelThe Task Manager (ALT+CTRL+DEL) can be very helpful in assessing if you have sessions of Excelleft open while you're programming in VBA. mon error many beginning programmers makewhen linking to Microsoft Office applications is to forget to close those applications in addition toexiting your own routine. If you don't useexcelAPP.Quit(excelApp is the object assigned to the Excel Application in the above code) for example, whenfinishing mand button code, you will leave a session of Excel running in the background eventhough your VBA routine has exited. There may be times when you want to leave Excel running afteryour VBA routine is finished. But be aware that running the VBA routine again and again will launchsession after session of Excel. If you're not sure how many sessions of Excel are open, or if Excelforbids you to edit a spreadsheet, use the Task Manager to see if Excel sessions are running and useit to close down an Excel session if Excel itself won't let you.Also, remember that new workbooks typically bring up three sheets by default. It is a good practice toeither create your own sheets before pointing to them, or renaming existing sheets so that you canspecify exactly what sheet you're passing and pulling information to and from. It is not a good idea toassume that everyone's Excel sessions will bring up the same default workbooks and worksheets youhave on your system: many users rely on different default spreadsheet templates.AutoCAD VBA/Access Coding ConceptsThe following General Declarations for treating the Access Application, workspaces, databases,tables and fields within it are assumed for the code examples provided in this course:Public wksObj As ObjectPublic dbsObj As ObjectPublic tblObj As ObjectPublic fldObj As ObjectPublic rstObj As Object10In the Excel treatment of this class, Excel was launched and potentially left visible to the user whilethe VBA applications were running. But there may be times when you want to exploit Excel or Accesswithout those applications being visible during your VBA routine, so for the Access treatment of thisclass, Access will be linked and utilized, but not made visible to the user during execution of VBAcode so that the VBA routine runs with Access 'in the background.'With Access, you must establish several essential objects to link to databases, create and edit themand query them. Remember, this is not a class on essential concepts in Access, but rather atreatment of the integration of Access with AutoCAD. You should pletely familiar with Accessmodels: the initial workspace (like the Excel Application) is needed to create and edit databases(.mdb files) which contain tables with multiple field types. There are several ways to work withMicrosoft Access databases from VBA, and the code examples used in this class are not intended toportrary &the right way& to do things. In the code examples for this course, table-type Recordsets areused to keep things simple (one table at a time, base-table directly manipulated, no ODBC, can beindexed by underlying table,etc).Important Reminder: both Excel and Access have Online help for VBA programming if you launchthem. Also, the AutoCAD VBA IDE's View/Object Browser (F2) function brings up Excel and Accessobjects and properties if you have established a reference to them.The code below shows how you can create a default workspace, create a new database file (.mdb),and create a table definition within it with typical field types in the table:mandButton1_Click()On Error Resume NextSet wksObj = DBEngine.Workspaces(0)Set dbsObj = wksObj.CreateDatabase(&mydbase.mdb&, dbLangGeneral)Set tblObj = dbsObj.CreateTableDef(&mytable&)With tblObj.Fields.Append .CreateField(&text&, dbText).Fields.Append .CreateField(&integer&, dbInteger).Fields.Append .CreateField(&long&, dbLong).Fields.Append .CreateField(&double&, dbDouble).Fields.Append .CreateField(&boolean&, dbBoolean).Fields.Append .CreateField(&memo&, dbMemo).Fields.Append .CreateField(&currency&, dbCurrency).Fields.Append .CreateField(&date&, dbDate)End WithdbsObj.TableDefs.Append tblObjdbsObj.TableDefs.RefreshEnd SubOnce a database and its list structures (tables with field definitions) have been defined, you can fill itwith records using a table--type recordset object. The code below opens an existing database file (theone created above) and adds a new record to it:mandButton2_Click()On Error Resume NextSet dbsObj = DBEngine.Workspaces(0).OpenDatabase(&mydbase.mdb&)Set rstObj = dbsObj.OpenRecordset(&mytable&, dbOpenTable)rstObj.AddNewrstObj!Text = &a text value&rstObj!integer = 1rstObj!double = 3.1415926rstObj!Boolean = TruerstObj!currency = &$4,240.54&rstObj!Date = &2/10/00&rstObj.UpdaterstObj.Close描绘勾画播放器加载中,请稍候...
该用户其他文档
文档介绍:
Integrating Ms Excel And Access With Autocad Vba Las Vegas, NevadaNovember 28 – December 1Speaker Name: dave espinosa-aguilarCourse: Integrating Microsoft Excel and Access with AutoCAD VBACourse Description: For years AutoCAD users have been trying to learn how to integratethe power of Excel spread...
内容来自淘豆网转载请标明出处.

我要回帖

更多关于 vba getobject 的文章

 

随机推荐