﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>A1VBCode Forums / Classic Visual Basic (VB 6 or earlier) / VBA(Excel, Word, etc...) </title><generator>InstantForum.NET v4.1.1</generator><description>A1VBCode Forums</description><link>http://www.a1vbcode.com/vbforums/</link><webMaster>forums@a1vbcode.com</webMaster><lastBuildDate>Thu, 09 Feb 2012 04:07:03 GMT</lastBuildDate><ttl>20</ttl><item><title>Attachmate Reflection - Determining cursor location</title><link>http://www.a1vbcode.com/vbforums/Topic31133-14-1.aspx</link><description>I am trying to do a screen scrape within Attachmate Reflection with VBA.  I would like to screen scrape everything from the current cursor location back to the beginning of the line.  I know how to do screen scrapes for defined row/column locations, but I do not know how to determine the current cursor location to be able to use for the row/column identifiers for the screen scrape.  Any assistance is appreciated.&lt;/P&gt;&lt;P&gt;I am trying to capture the last user prompt displayed prior to running macro code, so that the macro can look for the same prompt to appear again in order to trigger additional code to run.&lt;/P&gt;&lt;P&gt;-Ben Hofmann</description><pubDate>Mon, 09 Jan 2012 10:01:23 GMT</pubDate><dc:creator>bhofmann</dc:creator></item><item><title>Removing characters in a text</title><link>http://www.a1vbcode.com/vbforums/Topic30864-14-1.aspx</link><description>Hi..&lt;br&gt;&lt;br&gt;can someone please help me in doing a macro code.. i cant explain it well but ill make an example&lt;br&gt;&lt;br&gt;In excel file&lt;br&gt;&lt;br&gt;Column A       Column B(For Output)&lt;br&gt;&lt;br&gt;Dr. Abc Def      Abc Def&lt;br&gt;Dr Ghi Jkl          Ghi Jkl&lt;br&gt;&lt;br&gt;i want to remove all the "Dr" or any special characters(' , "" . ! #*) in a name so that it will result like in a column be.. how can i please do that in excel.. a little help please</description><pubDate>Wed, 02 Nov 2011 21:15:15 GMT</pubDate><dc:creator>chaw12</dc:creator></item><item><title>Go to Next Slide in Power Point</title><link>http://www.a1vbcode.com/vbforums/Topic29653-14-1.aspx</link><description>I am trying to go to the next slide in Power Point.&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;ActivePresentation.SlideShowWindow.View.Next&lt;/P&gt;&lt;P&gt;ActivePresentation.SlideShowWindow.View.GotoSlide #&lt;/P&gt;&lt;P&gt;but I getting this error:&lt;/P&gt;&lt;P&gt;&lt;FONT face=Calibri color=#000000 size=3&gt;run-time error ' -2147188160 (80048240)': Presentation (unknown member): invalid request. there is currently no slide show view for this presentation&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Calibri color=#000000 size=3&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT face=Calibri color=#000000 size=3&gt;Thank you very much for your help&lt;/FONT&gt;</description><pubDate>Tue, 21 Sep 2010 18:13:55 GMT</pubDate><dc:creator>samuvk</dc:creator></item><item><title>help with excel and access importing</title><link>http://www.a1vbcode.com/vbforums/Topic30823-14-1.aspx</link><description>Hi to all!&lt;br&gt;&lt;br&gt;I've created a simple program which will import all the data in an excel file to a database or more likely inserting the excel data to access database. but can someone please help with this!. I want my program to automatically write all the duplicate  data in a different sheet of the excel file if it has found a similar or existing data on the access database. And if there are some duplicate data found I want the excel to access importing  to skip on it and continue saving all those other data that has no duplicate on the database. By the way I've create an excel template with an exporting button and it is where the code resides and the data will be encoded also on the template. Hope some would help me with this.. &lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks in advance! &lt;br&gt;</description><pubDate>Sun, 23 Oct 2011 03:44:36 GMT</pubDate><dc:creator>chaw12</dc:creator></item><item><title>How do I make an excel spreadsheet calculate in stones and pounds?</title><link>http://www.a1vbcode.com/vbforums/Topic29363-14-1.aspx</link><description>Hi, How can I format the cells in an excel spreadsheet so that 1 would have a value of 0.14 rather than 0.10; so for instance 3 minus 0.3 would have an answer of 2.11?</description><pubDate>Tue, 22 Jun 2010 08:10:41 GMT</pubDate><dc:creator>lee91</dc:creator></item><item><title>getObject() and createObject()</title><link>http://www.a1vbcode.com/vbforums/Topic10994-14-1.aspx</link><description>&lt;P&gt;Dear all:&lt;/P&gt;&lt;P&gt;what is the difference between this two functions and how should i use them properly?&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description><pubDate>Tue, 26 Apr 2005 00:30:04 GMT</pubDate><dc:creator>cloudet</dc:creator></item><item><title>Transferring information from VB.Net to Excel</title><link>http://www.a1vbcode.com/vbforums/Topic12690-14-1.aspx</link><description>&lt;P&gt;What I have done so far is a basic form setup with 8 drop down boxes, after I have made my selections, I would like to keep a running tally of the information, lets say I want to make 10 different entries giving me 80 different selections, 10 rows of information consisting of columns of items. Then I want to be able to transfer it to an Excel spreadsheet for sorting purposes. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;POSSIBLE?????&lt;/P&gt;</description><pubDate>Sun, 10 Jul 2005 11:02:53 GMT</pubDate><dc:creator>montekass</dc:creator></item><item><title>macro failed please help</title><link>http://www.a1vbcode.com/vbforums/Topic30432-14-1.aspx</link><description>Hi all&lt;br&gt;&lt;br&gt;ive been given an excel document to try and fix. it is for an amateur poker league, and the original developer for the programme does not play anymore. &lt;br&gt;&lt;br&gt;the problem is with a macro button, which from what i can tell, is supposed to retrieve the date from the local pc, establish whether it is the tuesday or sunday event, retrieve the people playing that night (who have been manually entered into the relative nights page) and then place them randomly on a table.&lt;br&gt;&lt;br&gt;however this has stopped running.&lt;br&gt;&lt;br&gt;i have a very limited knowledge of java programming (couple classes at uni before i dropped out) so i could do with a bit of help!&lt;br&gt;&lt;br&gt;would anyone be able to help me, i can provide the coding from the debug and/or the actual file if necessary.&lt;br&gt;&lt;br&gt;Much appreciated&lt;br&gt;&lt;br&gt;Paul</description><pubDate>Sat, 11 Jun 2011 11:53:41 GMT</pubDate><dc:creator>cs_macker</dc:creator></item><item><title>Writing to remote computer</title><link>http://www.a1vbcode.com/vbforums/Topic30391-14-1.aspx</link><description>I use the following code to write to another computer on my home network. Can someone please tell me how to similarly write to a remote computer on the internet? The variable written (TRAP) is a small string.&lt;/P&gt;&lt;P&gt;BFILE = "&lt;A href="file://\\MANNANET\Documents\mojo.txt"&gt;\\MANNANET\Documents\mojo.txt&lt;/A&gt;"&lt;BR&gt;IFILENUM = FreeFile&lt;BR&gt;Open BFILE For Output As IFILENUM&lt;BR&gt;Print #IFILENUM, TRAP&lt;BR&gt;Close #IFILENUM</description><pubDate>Wed, 18 May 2011 13:19:50 GMT</pubDate><dc:creator>Coyote Paul</dc:creator></item><item><title>How do I make a number in an Excel formula sequentually count?</title><link>http://www.a1vbcode.com/vbforums/Topic29233-14-1.aspx</link><description>I have a column in Excel that contains a formula. It is the same on every row, except for one number. I want to make this value to automatically count up by one every row. I want the rest of the formula to remain identical. Can I get Excel to to this automatically or do I need to manually change the formula every single row? Thanks!</description><pubDate>Thu, 29 Apr 2010 02:57:10 GMT</pubDate><dc:creator>Newellmyra</dc:creator></item><item><title>What would the necessary code be for using a command button to insert text into a table in powerpoint? (AM A COMPLETE NOVICE)</title><link>http://www.a1vbcode.com/vbforums/Topic30138-14-1.aspx</link><description>I am a COMPLETE NOVICE!&lt;br&gt;&lt;br&gt;I am trying to use VBA for the very first time with no programming or code writing experience. &lt;br&gt;&lt;br&gt;I want to have a command button in a powerpoint presentation that when clicked, will insert text into a table on a separate slide, is this even possible? and would anybody be able to help me with the code that would be necessary if it is possible?&lt;br&gt;&lt;br&gt;Would massively appreciate any help or guidance?</description><pubDate>Mon, 07 Mar 2011 17:12:02 GMT</pubDate><dc:creator>slevinmj</dc:creator></item><item><title>UserForm and DropDown in word</title><link>http://www.a1vbcode.com/vbforums/Topic30005-14-1.aspx</link><description>Hi, I have a word document where I created a userform for the users that have to enter informations. I would like for it to place the infos in the word &amp;#100;ocument. In fact, the users click on the macro which load the userform. In the userform, there are textboxes where they enter informations and when they click "OK" the informations are directly insert in some textboxes on the word &amp;#100;ocument. Can someone help please?&lt;/P&gt;&lt;P&gt;Also, I would like to have some dropdown for the users to choose options. The objectif is for the users to save time by not having to type there text. So I'm gonna give them dropdown where they choose the standard sentences and when they click on their choice, they can change it by typing themself, like if they want to add some informtions to the sentence.&lt;/P&gt;&lt;P&gt;Thanks</description><pubDate>Wed, 09 Feb 2011 08:44:19 GMT</pubDate><dc:creator>alex1989</dc:creator></item><item><title>Outlook template with VBA /</title><link>http://www.a1vbcode.com/vbforums/Topic29874-14-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;Is it possible to make outlook template that gets hostname and username automatically from computer? &lt;br&gt;&lt;br&gt;I am trying to make a template where customer can write their name, phone number...,  but template would automatically get username, computername and maybe some other environment variables. I can do this in excel, but is it possible to make same to outlook template? &lt;br&gt;&lt;br&gt;&lt;br&gt;- isoA</description><pubDate>Mon, 03 Jan 2011 08:28:25 GMT</pubDate><dc:creator>isoA</dc:creator></item><item><title>VBA Excel Convert the excel file into readonly by codes...</title><link>http://www.a1vbcode.com/vbforums/Topic26903-14-1.aspx</link><description>Hello...... I am working on SQL Server 2000. I have a database that has almost 150 tables. I need to develop a report in excel. For this purpose i need to fetch data from my database and display the same in excel. &lt;br&gt;&lt;br&gt;After doing this i need to ensure that no one can edit the data that i have fetched. So somehow i need to lock the grid of the excel sheet in which i have displayed the report result. Cant do this........What to do?</description><pubDate>Thu, 29 Jan 2009 14:28:09 GMT</pubDate><dc:creator>Krishal Rajput</dc:creator></item><item><title>Microsoft Office Excel is waiting for another application to complete an OLE action.</title><link>http://www.a1vbcode.com/vbforums/Topic29703-14-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I write a number of VBA programs that have to wait for SAP to download to an Excel sheet, then the program can proceed. If the download takes more than 30 seconds or so I start getting the message in the subject in a msgbox with an OK button. Can this message be suppressed? The new Office Help is not very helpful. I have Office2007 now and learning to deal with it (not a happy camper).</description><pubDate>Wed, 13 Oct 2010 09:59:07 GMT</pubDate><dc:creator>macroman</dc:creator></item><item><title>Int resource for Long variables</title><link>http://www.a1vbcode.com/vbforums/Topic29684-14-1.aspx</link><description>Hello all,&lt;br&gt;&lt;br&gt;How can I get the result of Excel Int (=values without decimals) in VBA, for Long variables (over 32.768)? CLng rounds up or down, whereas I just need the integer values.&lt;br&gt;&lt;br&gt;Thank you!&lt;br&gt;Ivo</description><pubDate>Wed, 06 Oct 2010 17:39:00 GMT</pubDate><dc:creator>Ivo</dc:creator></item><item><title>Flip a page in word 2003 using VBA</title><link>http://www.a1vbcode.com/vbforums/Topic29496-14-1.aspx</link><description>Hi, how can i flip a page in word 2003 using VBA???&lt;/P&gt;&lt;P&gt;thanks</description><pubDate>Tue, 10 Aug 2010 15:12:05 GMT</pubDate><dc:creator>dtondo</dc:creator></item><item><title>I am new to VBA. I am not able to loop the data to process</title><link>http://www.a1vbcode.com/vbforums/Topic5198-14-1.aspx</link><description>Hi,&lt;br&gt;I am trying to call a transaction (ME32K) in SAP system through a Macro in Excel spread sheet. I provided data in Rows and Columns. Once I run Macro, it is processing only one row instead of all rows until the next row is empty. I attached spread sheet.&lt;br&gt;See the logic below.&lt;br&gt; --------------------------&lt;br&gt;Dim j As Integer&lt;br&gt;    &lt;br&gt;Public Sub add_bdcdata(BdcTable As Object, program As String, dynpro As String, dynbegin As String, fnam As String, fval As String)&lt;br&gt;&lt;br&gt;    Dim vField As Variant&lt;br&gt;       &lt;br&gt;    j = j + 1&lt;br&gt;    &lt;br&gt;    BdcTable.Rows.Add&lt;br&gt;    &lt;br&gt;    BdcTable.Value(j, "PROGRAM") = program      ' Program Name&lt;br&gt;    BdcTable.Value(j, "DYNPRO") = dynpro        ' Dynpro Number&lt;br&gt;    BdcTable.Value(j, "DYNBEGIN") = dynbegin    ' X if a screen&lt;br&gt;    BdcTable.Value(j, "FNAM") = fnam            ' Field Name&lt;br&gt;    BdcTable.Value(j, "FVAL") = fval            ' Field Value&lt;br&gt;        &lt;br&gt;    Debug.Print BdcTable.Value(j, "FVAL")&lt;br&gt;End Sub&lt;br&gt;&lt;br&gt;Public Sub rfc_call_transaction()&lt;br&gt;    Dim Functions As Object&lt;br&gt;    Dim RfcCallTransaction As Object&lt;br&gt;    Dim Messages As Object&lt;br&gt;    Dim BdcTable As Object&lt;br&gt;    &lt;br&gt;    ' Create the Function control (that is, the high-level Functions collection):&lt;br&gt;    Set Functions = CreateObject("SAP.Functions")&lt;br&gt;      &lt;br&gt;    ' Set the rest of Connection object values:&lt;br&gt;    Functions.Connection.System = "QA[Quality Assurance]"&lt;br&gt;    Functions.Connection.client = "100"&lt;br&gt;    Functions.Connection.user = "User1"&lt;br&gt;    Functions.Connection.password = ""&lt;br&gt;    Functions.Connection.language = "EN"&lt;br&gt;    &lt;br&gt;    If Functions.Connection.Logon(0, False) &lt;&gt; True Then&lt;br&gt;       Exit Sub&lt;br&gt;    End If&lt;br&gt;    &lt;br&gt;    Dim iBOB As Integer&lt;br&gt;       &lt;br&gt;  Do&lt;br&gt; &lt;br&gt;    ' Retrieve the Function object (the Connection object must be set up before Function objects can be created):&lt;br&gt;    Set RfcCallTransaction = Functions.Add("RFC_CALL_TRANSACTION")&lt;br&gt;&lt;br&gt;    ' Set the export parameters&lt;br&gt;    RfcCallTransaction.exports("TRANCODE") = "ME32K"&lt;br&gt;    RfcCallTransaction.exports("UPDMODE") = "S"&lt;br&gt;    Set BdcTable = RfcCallTransaction.Tables("BDCTABLE")&lt;br&gt;&lt;br&gt;    ' Set the tables parameter and add the data for the call transaction&lt;br&gt;    add_bdcdata BdcTable, "SAPMM06E", "205", "X", "", ""&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "RM06E-EVRTN"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "=KOPF"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "RM06E-EVRTN", ActiveCell.Offset(iBOB, 0).Value&lt;br&gt;    add_bdcdata BdcTable, "SAPMM06E", "201", "X", "", ""&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "EKKO-KTWRT"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "=BU"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-EKGRP", ActiveCell.Offset(iBOB, 1).Value&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-PINCR", "10"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-UPINC", "1"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-KDATB", ActiveCell.Offset(iBOB, 2).Value&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-KDATE", ActiveCell.Offset(iBOB, 3).Value&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-ZTERM", ActiveCell.Offset(iBOB, 4).Value&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-KTWRT", ActiveCell.Offset(iBOB, 5).Value&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-ZBD1T", "30"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-WKURS", "1.00000"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-INCO1", "DES"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-INCO2", "SAN DIEG0 CA"&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-TELF1", ActiveCell.Offset(iBOB, 6).Value&lt;br&gt;    add_bdcdata BdcTable, "", "", "", "EKKO-LIFRE", ActiveCell.Offset(iBOB, 7).Value&lt;br&gt;    &lt;br&gt;    'End SubCall the function (if the result is false, then display a message):&lt;br&gt; If RfcCallTransaction.Call = True Then&lt;br&gt;         Set Messages = RfcCallTransaction.imports("MESSG")&lt;br&gt;         MsgBox Messages.Value("MSGTX")&lt;br&gt;     Else&lt;br&gt;      MsgBox " Call Failed! error: " + GetCustomers.Exception&lt;br&gt;     End If&lt;br&gt;iBOB = iBOB + 1&lt;br&gt;Loop Until IsEmpty(ActiveCell.Offset(iBOB, 0))&lt;br&gt;&lt;br&gt;Functions.Connection.Logoff&lt;br&gt; End Sub&lt;br&gt;-----------------------------------------&lt;br&gt;Thank you&lt;br&gt;GuestUser</description><pubDate>Tue, 19 Oct 2004 21:57:40 GMT</pubDate><dc:creator>GuestUser</dc:creator></item><item><title>How can I make excel recognize the number is a measurement?</title><link>http://www.a1vbcode.com/vbforums/Topic29362-14-1.aspx</link><description>I need help with making excel read a formula. For example I have 4' 5" typed in one cell. i want excel to recognize that as "ft" "in". And this is important because i have an sumif scenerio that is suppose to subtract according to a scenerio. Is there a way for excel to recognize the entry as measurement? If so, how can i make it recognize it?</description><pubDate>Tue, 22 Jun 2010 08:09:29 GMT</pubDate><dc:creator>lee91</dc:creator></item><item><title>updating excel object in word</title><link>http://www.a1vbcode.com/vbforums/Topic29310-14-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I've a word document with excel object. The cell b1 is set to import data from a text file. How can I get this cell to import data automatically when the word document opens without any user interaction?&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR&gt;</description><pubDate>Sun, 23 May 2010 22:21:05 GMT</pubDate><dc:creator>slamdunk</dc:creator></item><item><title>Updating excel object in word</title><link>http://www.a1vbcode.com/vbforums/Topic29309-14-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I've a word document with excel object. The cell b1 is set to import data from a text file. How can I get this cell to import data automatically when the word document opens without any user interaction?&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR&gt;</description><pubDate>Sun, 23 May 2010 22:20:25 GMT</pubDate><dc:creator>slamdunk</dc:creator></item><item><title>Excel Formula?</title><link>http://www.a1vbcode.com/vbforums/Topic29208-14-1.aspx</link><description>I want to create a formula or a conditional format in Excel that will allow me to examine a date and see if it is 1 year past the current date. And turn the cell Red. Any help is appreciated.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;______________________&lt;br&gt;&lt;a href="http://excel2007.exceltip.com/buttons-and-triangles-in-cells" target="_blank" class="SmlLinks"&gt;Buttons and Triangles in cells&lt;/a&gt;</description><pubDate>Mon, 26 Apr 2010 05:23:07 GMT</pubDate><dc:creator>Steveclark</dc:creator></item><item><title>How to export outlook calendar to excel with exclusion?</title><link>http://www.a1vbcode.com/vbforums/Topic29207-14-1.aspx</link><description>hi...I am trying to export an outlook calendar to excel. I know the normal process for doing this, but I am specifically trying to exclude a certain word from the export. For example, in the subject line of some of the appointments in the calendar it says "done" and I would like to create an excel sheet of all the appointments that are still not "done". I am using Excel 2007. Thanks in advance for your help!&lt;br&gt;&lt;br&gt;&lt;br&gt;______________________&lt;br&gt;&lt;a href="http://excel2007.exceltip.com/buttons-and-triangles-in-cells" target="_blank" class="SmlLinks"&gt;Buttons and Triangles in cells&lt;/a&gt;</description><pubDate>Mon, 26 Apr 2010 05:20:19 GMT</pubDate><dc:creator>Steveclark</dc:creator></item><item><title>ActiveX ComboBox Line Code issue in Word</title><link>http://www.a1vbcode.com/vbforums/Topic29193-14-1.aspx</link><description>&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" border=0&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align=left&gt;I created an ActiveX ComboBox list in my 2003 Word document using Visual Basic Line Code. Unfortunately, everytime I reopen the document, I have to reactivate the code in Visual Basic before I can access it in the drop down list in the word doc. Please look at the code below and let me know if I am missing something that will allow this to continuely activate without my running it every time.&lt;BR&gt;&lt;BR&gt;Private Sub ComboBox1_Change()&lt;BR&gt;Me.ComboBox1.List = Split(" option1 option2 option3")&lt;BR&gt;End Sub&lt;BR&gt;&lt;BR&gt;Please help! Thanks!&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description><pubDate>Wed, 21 Apr 2010 19:38:59 GMT</pubDate><dc:creator>rusty_cd</dc:creator></item><item><title>how to embed ms office into vb 6</title><link>http://www.a1vbcode.com/vbforums/Topic28895-14-1.aspx</link><description>hi sir...i just want to ask if how i could &lt;/P&gt;&lt;P&gt;embed microsoft office application in vb 6&lt;/P&gt;&lt;P&gt;that the content will be saved in the database and can be viewed &lt;/P&gt;&lt;P&gt;from the database....&lt;/P&gt;&lt;P&gt;mysql database..&lt;/P&gt;&lt;P&gt;thanks..</description><pubDate>Tue, 16 Feb 2010 06:35:30 GMT</pubDate><dc:creator>belat</dc:creator></item><item><title>Problems running VBA code within Excel</title><link>http://www.a1vbcode.com/vbforums/Topic28892-14-1.aspx</link><description>Have created the following code to export Excel worksheet data to Access database. Had early issues with registering type to allow system to recognize the Dim statement. Setup object library to include Microsoft DAO 3.6 Object Library, but now when trying to compile macro I get a runtime error '429' that an ActiveX component can't create object on the Set db statement of the code. What am I missing?&lt;/P&gt;&lt;P&gt;Sub DAOFromExcelToAccess()&lt;BR&gt;'exports data from the active worksheet to a table in an Access database&lt;BR&gt;'this procedure must be edited before use&lt;BR&gt;Dim db As Database, rs As Recordset, r As Long&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #dddd33"&gt;Set db = OpenDatabase("C:\Documents and Settings\sward\My Documents\Austell Equipment\GM-130\Productivity Reports\Machine_Logging.mdb")&lt;BR&gt;&lt;/FONT&gt;'open the database&lt;BR&gt;Set rs = db.OpenRecordset("GM130", dbOpenTable)&lt;BR&gt;'get all records in a table&lt;BR&gt;r = 1 'the start row in the worksheet&lt;BR&gt;Do While Len(Range("A" &amp;amp; r).Formula) &amp;gt; 0&lt;BR&gt;'repeat until first empty cell in column A&lt;BR&gt;With rs&lt;BR&gt;.AddNew 'create a new record&lt;BR&gt;'add values to each field in the record&lt;BR&gt;.Fields("Customer") = Range("A" &amp;amp; r).Value&lt;BR&gt;.Fields("Metallizer") = Range("B" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Date") = Range("C" &amp;amp; r).Value&lt;BR&gt;.Fields("Vac_Roll_Number") = Range("D" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Quality") = Range("E" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Performance") = Range("F" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Downtime") = Range("G" &amp;amp; r).Value&lt;BR&gt;.Fields("Slitter") = Range("H" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Date") = Range("I" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Quality") = Range("J" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Performance") = Range("K" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Downtime") = Range("L" &amp;amp; r).Value&lt;BR&gt;'add more fields if necessary...&lt;BR&gt;.Update 'store the new record&lt;BR&gt;End With&lt;BR&gt;r = r + 1 'next row&lt;BR&gt;Loop&lt;BR&gt;rs.Close&lt;BR&gt;Set rs = Nothing&lt;BR&gt;db.Close&lt;BR&gt;Set db = Nothing&lt;/P&gt;&lt;P&gt;End Sub&lt;BR&gt;</description><pubDate>Mon, 15 Feb 2010 11:17:24 GMT</pubDate><dc:creator>sclward</dc:creator></item><item><title>Export Excel worksheet to Access using VBA</title><link>http://www.a1vbcode.com/vbforums/Topic28797-14-1.aspx</link><description>I'm wanting to export an Excel worksheet to an existing Access table. I want to do this from within Excel using VBA and a user macro. I want to be able to append the existing records within the Access table. What's the best way to do this? Thanks.</description><pubDate>Sun, 31 Jan 2010 12:08:31 GMT</pubDate><dc:creator>sclward</dc:creator></item><item><title>Use sub</title><link>http://www.a1vbcode.com/vbforums/Topic28775-14-1.aspx</link><description>I'm using Visual Basic in Excel 2003.&lt;/P&gt;&lt;P&gt;I have a Sub definied as follow:&lt;/P&gt;&lt;P&gt;Public Sub Conect(ByVal hServer As Long, ByVal hpool As Long, ByVal vServerName As Long, ByVal vUserName As Long, ByVal vPassword As Long, hUser As Long) &lt;/P&gt;&lt;P&gt;  BODY&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;The thing is when I try to call the Sub I'm doing as follow:&lt;/P&gt;&lt;P&gt;Sub Conect(hServer, hpool, vServerName, vUserName , vPassword , hUser&amp;nbsp&lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Wink.gif" border="0" title="Wink"&gt; &lt;/P&gt;&lt;P&gt;When I call the Sub I get the next error message:&lt;/P&gt;&lt;P&gt;Compile error: &lt;/P&gt;&lt;P&gt;Expected:=&lt;/P&gt;&lt;P&gt;Could anyone help me to understand why is this happening and how can I fix it?&lt;/P&gt;&lt;P&gt;The thing is that when I use only one variable I don't have any problem</description><pubDate>Thu, 28 Jan 2010 15:13:10 GMT</pubDate><dc:creator>samuvk</dc:creator></item><item><title>Need code for expanding Word table rows with copied default formfields</title><link>http://www.a1vbcode.com/vbforums/Topic28712-14-1.aspx</link><description>I'm working on a Word template (form) that contains tables having a mix of formfields such as textinput, dropdowns, and checkboxes.  I would like to provide a single default data row for each table, but if the user enters valid data in the first cell of the last row, the table expands with a new default row below the active cell the user just filled in. The following code is latest draft for a table where default textinput for cell(1) is "nn", but requires at least two data rows and is not smart enough to know if another default row is available below the active (selected) cell:&lt;/P&gt;&lt;P&gt;Sub AddRow()&lt;BR&gt;    Dim thisDoc As Document&lt;BR&gt;    Set thisDoc = ActiveDocument&lt;BR&gt;    Dim oTable As Table&lt;BR&gt;    Dim oCell As Cell&lt;BR&gt;    Dim oPrevRow As Row, oNewRow As Row&lt;BR&gt;    Dim tmp&lt;BR&gt;    'Unprotect Document&lt;BR&gt;    If thisDoc.ProtectionType &amp;lt;&amp;gt; wdNoProtection Then&lt;BR&gt;        thisDoc.Unprotect&lt;BR&gt;    End If&lt;BR&gt;   &lt;BR&gt;    tmp = Selection.Text&lt;BR&gt;    If tmp &amp;lt;&amp;gt; "nn" Then&lt;BR&gt;        If tmp &amp;lt;&amp;gt; "n" Then&lt;BR&gt;        'Selection.FormFields(1).TextInput.Clear&lt;BR&gt;            ' Copy last row&lt;BR&gt;            Set oTable = thisDoc.Tables(10)&lt;BR&gt;            Set oPrevRow = oTable.Rows(oTable.Rows.Count)&lt;BR&gt;            oPrevRow.Range.Copy&lt;BR&gt;            Set oNewRow = oTable.Rows(oTable.Rows.Count)&lt;BR&gt;            ' Copy last row to new row&lt;BR&gt;            oNewRow.Range.Paste&lt;BR&gt;            &lt;BR&gt;        End If&lt;BR&gt;    End If&lt;BR&gt;    'Protect Document&lt;BR&gt;    If thisDoc.ProtectionType = wdNoProtection Then&lt;BR&gt;        thisDoc.Protect wdAllowOnlyFormFields, NoReset:=True&lt;BR&gt;    End If&lt;BR&gt;End Sub&lt;/P&gt;&lt;P&gt;I also would like to ensure that the formfields in the new row are reset to their default values without resetting the entire form.</description><pubDate>Tue, 19 Jan 2010 15:34:52 GMT</pubDate><dc:creator>SeefDawg</dc:creator></item><item><title>Loss VBA Password</title><link>http://www.a1vbcode.com/vbforums/Topic28545-14-1.aspx</link><description>Anybody can help me how to crack my excel VBA password?</description><pubDate>Sat, 12 Dec 2009 03:01:26 GMT</pubDate><dc:creator>yuro84</dc:creator></item><item><title>A template for making bound documents</title><link>http://www.a1vbcode.com/vbforums/Topic28585-14-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Calibri&gt;I would like to have a template for preparation of bound documents.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Calibri&gt;For example, I have prepared a document of 4 pages. On an extra (5&lt;SUP&gt;th&lt;/SUP&gt;, auxiliary) page there is an inscription “Bound, numbered and sealed are 4 (Four) sheet(s)”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Calibri&gt;Then I cut this inscription with scissors, staple the document, sew it with a thread, and then glue the sticker.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;</description><pubDate>Sun, 27 Dec 2009 04:23:28 GMT</pubDate><dc:creator>Pepper</dc:creator></item><item><title>Testing for blank and/or empty rows or columns</title><link>http://www.a1vbcode.com/vbforums/Topic28584-14-1.aspx</link><description>I wish to loop through each row of a set area of a worksheet and delete only those rows which have nothing stored, regardless of whether they have never been used, or, if they once had contents in a cell/s that have since been cleared.  If any cell in the row has had its formatting altered or anything, I still wish it to be considered empty; as long as there is no formula or entry in a cell, I want it detected to be deleted.&lt;/P&gt;&lt;P&gt;1.  My text has the line&lt;/P&gt;&lt;P&gt;If IsEmpty(Range("A1")) then ....&lt;/P&gt;&lt;P&gt;which will test only if a particular cell is empty.&lt;/P&gt;&lt;P&gt;If I try&lt;/P&gt;&lt;P&gt;If IsEmpty(rows(1)) then&lt;/P&gt;&lt;P&gt;there is no compile error, but, if row 1 (1) has nothing in any cell, it still won't match if I have nothing in row 1 of the worksheet.&lt;/P&gt;&lt;P&gt;2.  What is the difference between somthing being &lt;EM&gt;empty&lt;/EM&gt; or something being &lt;EM&gt;null&lt;/EM&gt;?  I have tried other codes with &lt;EM&gt;null&lt;/EM&gt; to try to detect empty lines, but they've caused run errors or again logical ones.&lt;/P&gt;&lt;P&gt;Many thanks to anyone who can assist :-)</description><pubDate>Sat, 26 Dec 2009 19:08:40 GMT</pubDate><dc:creator>devophil</dc:creator></item><item><title>VBA MSG BOX</title><link>http://www.a1vbcode.com/vbforums/Topic28546-14-1.aspx</link><description>Hi,&lt;br&gt;Can someone help me? I want to develop my spreadsheet as below;&lt;br&gt;Let say if:&lt;br&gt;&lt;br&gt;A1&gt;12.5 the off spec msg box will appear&lt;br&gt;B1&gt;12,  the off spec msg box appear&lt;br&gt;&lt;br&gt;In the msg box:&lt;br&gt;A= offspec. Reason = To be filled by user. Action taken: To be filled by user&lt;br&gt;B=offspec. Reason=To be filled in by user. Action taken: To be filled by user&lt;br&gt;Ok button.&lt;br&gt;&lt;br&gt;After click ok button, another form appear in excel format and the input at the “to be filled by user” will be appear in the form&lt;br&gt;</description><pubDate>Sat, 12 Dec 2009 04:17:46 GMT</pubDate><dc:creator>yuro84</dc:creator></item><item><title>Controls- Populating a textbox with Access values</title><link>http://www.a1vbcode.com/vbforums/Topic28477-14-1.aspx</link><description>Hi &lt;/P&gt;&lt;P&gt;I'm working on Access 2003 and i was creating a report. Now that i'm done creating my report how do i go about binding textboxes [Unbound Fields] to dbase or what's the code that populates the the textbox in the report which should pick up a certain column in a certain table in a database</description><pubDate>Thu, 03 Dec 2009 07:57:27 GMT</pubDate><dc:creator>Sunzah</dc:creator></item><item><title>Excel Update</title><link>http://www.a1vbcode.com/vbforums/Topic28376-14-1.aspx</link><description>Hey Guys,&lt;br&gt;&lt;br&gt;I have been left an excel spreadsheet from the last IT person here. He left some documents on how to setup the machine for this but left a whole load of information out, for example that I need to register WINSOCK.&lt;br&gt;&lt;br&gt;I have got one PC working with the spreadsheet but the other machine errors when when I try to do an update with "#ErrorDB Error: Update AskDiscountMargin not updated." If I run excel with as Admin it works fine.&lt;br&gt;&lt;br&gt;What would the best way of debuging this be?&lt;br&gt;&lt;br&gt;The sheet is updating a MySQL database, I have all the permissions on WINSOCK etc.&lt;br&gt;&lt;br&gt;Thanks for your help.&lt;br&gt;&lt;br&gt;Chris</description><pubDate>Fri, 13 Nov 2009 11:03:28 GMT</pubDate><dc:creator>kippi</dc:creator></item><item><title>DATE COLUMN</title><link>http://www.a1vbcode.com/vbforums/Topic28235-14-1.aspx</link><description>I am connecting to Oracle through MS QUERY.  The result is put into excel.&lt;P&gt;Set Query = QuerySheet.QueryTables("MONEY")&lt;BR&gt;Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH'), SUM(NUMB_TBLE.NUMB_PAY) " _&lt;BR&gt;&amp;amp; "FROM JES.NUMB TBLE NUMB TBLE,&lt;BR&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _&lt;BR&gt;&amp;amp; "WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN (" &amp;amp; NumList &amp;amp; ") " _&lt;BR&gt;&amp;amp; "Group by numb_tble.numb_name, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH')&lt;BR&gt;ORDER BY TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH')&lt;/P&gt;&lt;P&gt;This doesn't accomplish what I want&lt;/P&gt;&lt;P&gt;In my query, I want to display the month in words&lt;BR&gt;I want to order the month by number&lt;/P&gt;&lt;P&gt;For example the result would be&lt;/P&gt;&lt;P&gt;Jones January 10.00&lt;BR&gt;Doe April 20.00&lt;/P&gt;&lt;P&gt;How do I do this?</description><pubDate>Thu, 24 Sep 2009 15:34:35 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>Column alias</title><link>http://www.a1vbcode.com/vbforums/Topic28232-14-1.aspx</link><description>&lt;DIV id=post_message_1342589&gt;&lt;DIV class=KonaBody&gt;I would like to put column aliases on some of the fields in the SELECT statement.&lt;BR&gt;&lt;BR&gt;Private Sub CommandButton1_Click()&lt;BR&gt;Dim NumList As String&lt;BR&gt;Dim SourceBook As Workbook&lt;BR&gt;Dim ListSheet As Worksheet&lt;BR&gt;Dim QuerySheet As Worksheet&lt;BR&gt;Dim Query As QueryTable&lt;BR&gt;Dim Numb As String&lt;BR&gt;&lt;BR&gt;Set SourceBook = Application.ActiveWorkbook&lt;BR&gt;Set ListSheet = SourceBook.Worksheets("Main")&lt;BR&gt;Set QuerySheet = SourceBook.Worksheets("MONEY")&lt;BR&gt;Numb = Range("H6")&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If ListSheet.Cells(6, 8).Value = "" Then Exit Sub&lt;BR&gt;NumList = "'" &amp;amp; ListSheet.Cells(6, 8).Value &amp;amp; "'"&lt;BR&gt;&lt;BR&gt;Set Query = QuerySheet.QueryTables("MNY")&lt;BR&gt;Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, extract(month from NUMB_DATES_TBLE.DAY_MTH_YR) " _&lt;BR&gt;&amp;amp; "FROM JES.NUMB TBLE NUMB TBLE,&lt;BR&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _&lt;BR&gt;&amp;amp; "WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN (" &amp;amp; NumList &amp;amp; ") " _&lt;BR&gt;&amp;amp; "Group by numb_tble.numb_name, &lt;BR&gt;extract(month from NUMB_DATES_TBLE.DAY_MTH_YR)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Query.Refresh (False)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;End Sub &lt;BR&gt;&lt;BR&gt;I want to alias the column NUMB_TBLE.NUMB_NAME, I want it to say LAST_NAME&lt;BR&gt;&lt;BR&gt;I have tried NUMB_TBLE.NUMB_NAME AS LAST_NAME. It works but it changes the order of the columns. I do not want the order of the columns to change.&lt;BR&gt;&lt;BR&gt;When the query runs, in Excel, the column headings are DAY_MTH_YR and LAST_NAME&lt;BR&gt;&lt;BR&gt;If I do not use the alias, the column headings in Excel are NUMB_NAME, DAY_MTH_YR.&lt;BR&gt;&lt;BR&gt;I want the order to still be Name of the person, Date of the transaction.&lt;BR&gt;&lt;BR&gt;When I use the alias, it becomes Date of the transaction, Name of the person&lt;BR&gt;&lt;BR&gt;The order changes.&lt;BR&gt;&lt;BR&gt;How do I alias the columns without effecting the order of the columns.&lt;BR&gt;&lt;BR&gt;I connect to the Oracle database and the result set is put into excel&lt;/DIV&gt;&lt;/DIV&gt;&lt;!-- / message --&gt;&lt;DIV style="MARGIN-TOP: 10px" align=right&gt;&lt;!-- controls --&gt;&lt;IMG id=progress_1342589 style="DISPLAY: none" alt="" src="http://www.xtremevbtalk.com/x_images/images/misc/progress.gif"&gt;&lt;/DIV&gt;</description><pubDate>Wed, 23 Sep 2009 13:26:02 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>RUN-TIME ERROR '1004' General OBDC Errror</title><link>http://www.a1vbcode.com/vbforums/Topic28228-14-1.aspx</link><description>&lt;OL&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Sub&lt;/SPAN&gt; CommandButton1_Click&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; NumList &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;String&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; SourceBook &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; Workbook&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; ListSheet &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; Worksheet&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; QuerySheet &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; Worksheet&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; Query &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; QueryTable&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; Numb &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;String&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt; &lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; SourceBook = Application.&lt;SPAN&gt;ActiveWorkbook&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; ListSheet = SourceBook.&lt;SPAN&gt;Worksheets&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"Main"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; QuerySheet = SourceBook.&lt;SPAN&gt;Worksheets&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"MONEY"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;Numb = Range&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"H6"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt; &lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;If&lt;/SPAN&gt; ListSheet.&lt;SPAN&gt;Cells&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #cc66cc"&gt;6&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #cc66cc"&gt;8&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #7f5f00"&gt;""&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Sub&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;NumList = &lt;SPAN style="COLOR: #7f5f00"&gt;"'"&lt;/SPAN&gt; &amp;amp; ListSheet.&lt;SPAN&gt;Cells&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #cc66cc"&gt;6&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #cc66cc"&gt;8&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"'"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt; &lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; Query = QuerySheet.&lt;SPAN&gt;QueryTables&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"MNY"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;Query.&lt;SPAN&gt;Sql&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #7f5f00"&gt;"SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH'),  TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'YYYY'), SUM(NUMB_TBLE. PAY_IN), SUM(NUMB_TBLE. PAY_OUT),  SUM(NUMB_TBLE. NET_PAY)  "&lt;/SPAN&gt;_&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"FROM JES.NUMB TBLE NUMB TBLE,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE"&lt;/SPAN&gt; _&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN ("&lt;/SPAN&gt; &amp;amp; NumList &amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;") "&lt;/SPAN&gt; _&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"Group by numb_tble.numb_name,  TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'YYYY'), TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;Query.Refresh (False)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;End Sub &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;When I add SUM(NUMB_TBLE. NET_PAY) to the code, I receive General ODBC error.&lt;BR&gt;&lt;BR&gt;Before I add this code, the query works.&lt;BR&gt;&lt;BR&gt;What is going on?&lt;BR&gt;&lt;BR&gt;How do I fix it? &lt;!-- / message --&gt;&lt;!-- edit note --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;&lt;/SPAN&gt; </description><pubDate>Wed, 23 Sep 2009 08:55:52 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>Run-Time Error '9' Subscript out of range</title><link>http://www.a1vbcode.com/vbforums/Topic28215-14-1.aspx</link><description>&lt;DIV id=post_message_3611508&gt;I am using a spreadsheet. It has two tabs MAIN and TOTAL CASH. On the MAIN tab is a BUTTON and a cell where to enter a number. After you put a number in the cell and click the button, the results of the query is in the tab TOTAL CASH&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Private Sub CommandButton1_Click()&lt;BR&gt;Dim NumList As String&lt;BR&gt;Dim SourceBook As Workbook&lt;BR&gt;Dim ListSheet As Worksheet&lt;BR&gt;Dim QuerySheet As Worksheet&lt;BR&gt;Dim Query As QueryTable&lt;BR&gt;Dim Numb As String&lt;BR&gt;&lt;BR&gt;Set SourceBook = Application.ActiveWorkbook&lt;BR&gt;Set ListSheet = SourceBook.Worksheets("Main")&lt;BR&gt;Set QuerySheet = SourceBook.Worksheets("TOTAL CASH")&lt;BR&gt;Numb = Range("H6")&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If ListSheet.Cells(6, 8).Value = "" Then Exit Sub&lt;BR&gt;NumList = "'" &amp;amp; ListSheet.Cells(6, 8).Value &amp;amp; "'"&lt;BR&gt;&lt;BR&gt;Set Query = QuerySheet.QueryTables("T_CASH")&lt;BR&gt;Query.Sql = "SELECT CUST_TBLE.NAME, CASH_TBLE.SAV_AMT " _&lt;BR&gt;&amp;amp; "FROM JES.CUST TBLE CUST TBLE,&lt;BR&gt;JES.CASH_TBLE CASH_TBLE" _&lt;BR&gt;&amp;amp; "WHERE CUST_TBLE.NUM_ID = CASH_TBLE.NUM_ID AND CUST_TBLE.NUM_CODE IN (" &amp;amp; NumList &amp;amp; ") " &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Query.Refresh (False)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;End Sub&lt;BR&gt;&lt;BR&gt;This works.&lt;BR&gt;&lt;BR&gt;In a new workbook, I created two tabs, MAIN and MONEY. On the MAIN tab is a BUTTON and a cell where to enter a number. After you put a number in the cell and click the button, I want the results of the query in the tab TOTAL CASH. This is not working. This code is very simiar to the code above that works. The only difference is the query. I am getting this error: run-time error '9'-- Subscript out of range. This is the line with the error:&lt;BR&gt;Set Query = QuerySheet.QueryTables("MNY")&lt;BR&gt;&lt;BR&gt;Why does one code work, and the other code does not?&lt;BR&gt;&lt;BR&gt;This is the code that does not work.&lt;BR&gt;&lt;BR&gt;Private Sub CommandButton1_Click()&lt;BR&gt;Dim NumList As String&lt;BR&gt;Dim SourceBook As Workbook&lt;BR&gt;Dim ListSheet As Worksheet&lt;BR&gt;Dim QuerySheet As Worksheet&lt;BR&gt;Dim Query As QueryTable&lt;BR&gt;Dim Numb As String&lt;BR&gt;&lt;BR&gt;Set SourceBook = Application.ActiveWorkbook&lt;BR&gt;Set ListSheet = SourceBook.Worksheets("Main")&lt;BR&gt;Set QuerySheet = SourceBook.Worksheets("MONEY")&lt;BR&gt;Numb = Range("H6")&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If ListSheet.Cells(6, 8).Value = "" Then Exit Sub&lt;BR&gt;NumList = "'" &amp;amp; ListSheet.Cells(6, 8).Value &amp;amp; "'"&lt;BR&gt;&lt;BR&gt;Set Query = QuerySheet.QueryTables("MNY")&lt;BR&gt;Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, extract(month from NUMB_DATES_TBLE.DAY_MTH_YR) " _&lt;BR&gt;&amp;amp; "FROM JES.NUMB TBLE NUMB TBLE,&lt;BR&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _&lt;BR&gt;&amp;amp; "WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN (" &amp;amp; NumList &amp;amp; ") " _&lt;BR&gt;&amp;amp; "Group by numb_tble.numb_name, &lt;BR&gt;extract(month from NUMB_DATES_TBLE.DAY_MTH_YR)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Query.Refresh (False)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;End Sub &lt;/DIV&gt;&lt;!-- / message --&gt;</description><pubDate>Sun, 20 Sep 2009 14:15:20 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>Trouble with searching and displaying an array</title><link>http://www.a1vbcode.com/vbforums/Topic28154-14-1.aspx</link><description>Hey all, My name is Bill and i an a uni student. i am having trouble displaying the result of a search i am trying to put together.After clicking on the search button, my msgbox comes up saying that there are no matching record, but i know there is. the question is as follows:&lt;br&gt;Implement a search function so you can look up a part number in your table. Your search operation should return the result in a messageBox.&lt;br&gt;&lt;br&gt;here is my code:&lt;br&gt;&lt;br&gt;Public MyValue1 As String&lt;br&gt;Dim Formlength, looking As Integer&lt;br&gt;Public MyTable As Object&lt;br&gt;&lt;br&gt;Public MyValue1 As String&lt;br&gt;Dim Formlength, looking As Integer&lt;br&gt;Public MyTable As Object&lt;br&gt;&lt;br&gt;Private Sub Search_Button_Click()&lt;br&gt;Set MyTable = ActiveDocument.Tables(1)&lt;br&gt;Formlength = MyTable.Rows.Count&lt;br&gt;If looking &gt; Formlength Then&lt;br&gt;'reset looking if not first search&lt;br&gt;looking = 1&lt;br&gt;End If&lt;br&gt;If looking = 0 Then&lt;br&gt;'initialize looking for the first search&lt;br&gt;looking = 1&lt;br&gt;End If&lt;br&gt;MyValue1 = Search_String_1.Value&lt;br&gt;'get the search string&lt;br&gt;If MyValue1 = "" Then&lt;br&gt;MsgBox ("You have not entered a partnumber to search for!")&lt;br&gt;Unload UserForm1&lt;br&gt;Set MyTable = Nothing&lt;br&gt;Exit Sub&lt;br&gt;End If&lt;br&gt;Set MyTable = ActiveDocument.Tables(1)&lt;br&gt;looking = looking + 1&lt;br&gt;'increment in case the search function was exited early&lt;br&gt;Call findit&lt;br&gt;End Sub&lt;br&gt;Public Sub findit()&lt;br&gt;While looking &lt; Formlength + 1&lt;br&gt;'setup the loop&lt;br&gt;If MyValue1 = MyTable.Cell(looking, 1) Then&lt;br&gt;Debug.Print MyTable.Cell(looking, 1)&lt;br&gt;'if the search string is found in this cell&lt;br&gt;MyTable.Cell(looking, 1).Select&lt;br&gt;partnumberprint.Value = MyTable.Cell(looking, 1)&lt;br&gt;costprint.Value = MyTable.Cell(looking, 2)&lt;br&gt;quantityprint.Value = MyTable.Cell(looking, 3)&lt;br&gt;totalprint.Value = MyTable.Cell(looking, 4)&lt;br&gt;' print result in text box&lt;br&gt;Exit Sub&lt;br&gt;End If&lt;br&gt;looking = looking + 1&lt;br&gt;Wend&lt;br&gt;If looking &gt; Formlength Then&lt;br&gt;MsgBox ("End of records! Your searched record has not been found.")&lt;br&gt;looking = Formlength&lt;br&gt;'looking reset so it will be initialized correctly in the next search&lt;br&gt;Unload UserForm1&lt;br&gt;End If&lt;br&gt;End Sub&lt;br&gt;End Sub</description><pubDate>Sat, 05 Sep 2009 20:51:22 GMT</pubDate><dc:creator>Bill</dc:creator></item></channel></rss>
