vba

Inaccuracies using TextWidth() in VBA

I'm trying to get the length of a string in order to format a report using VBA in Access 2000. Yes I know this old but it's what I've been asked to do. I want to get the width of the string when printed; exactly what TextWidth() is meant to return. What I'm finding is that for strings ranging for 4-20 characters the returned value can ra...

Move from one cell to another and count the number of rows in between two data

I have got one column with 250 rows. The data fed is 0 and 1 randomly in these rows. I need to find the number of row between any two 1's. I need to write a macro for the same.For ex: if my column is as follow: A1 0 B1 2 A2 0 B2 2 A3 0 A4 1 A5 0 A6 0 A7 1 A8...

splite the entire row with a specific YEAR value to other worksheet. vba excel

Hello, I've got a few columns of data in which 3 columns contain dates (in date format : dd/mm/yyyy) . Now, I want excel to seperate the entire row into another worksheet according to the YEAR in the 3 columns. In cell ( 17,B) and (18,B), i type in the year for reference ( which i want excel to seperate the rows accoding to this year)...

Best way in MS Access to edit data enriched with data from an ODBC table

This is the simplified version of the problem: We have a table on an Oracle Database. We cannot extend this table (bought app). We need to describe each row of that Oracle table with some text. So the descission has been to use MS Access for this. So I created in Access a table (Call it ACCESS_TABLE). The table consists of ID and MEMOT...

Com DLL In VB6?

I have a class in an Excel file and my boss wants me to create that class into a COM DLL. I don't want to have him walk me through the entire process because he's quite busy. Can any of you point me in the right direction and help me out with this? ...

How do you find the closest point to line on a geometric network in VBA?

I work in GIS with VBA. I have a geometric network that contains 2 layer River (polyline) and Hydrometry station (Point). I want to find the closest Point to the selected River, but I want that distance to be measured on the network, not the direct distance. How can I code this in VBA? ...

Application.Username VB6 Equivalent??

I can use Application.Username in Excel's VBA editor to return the username of the current user. What is the equivalent in VB6? ...

Count number of different cells in VBA

Hello, I want to count no of different cells which are selected using VBA. Consider if we select five distinct cells - D5, C2, E7, A4, B1. Is there a way I can count these number of cells. Secondly how can I retrieve data in these cells. Lets say I want to store it in an array. Thank you for the help. ...

Microsoft Word: Change Font of Characters Missing In Default Font

I am trying to use VBA in Microsoft Word to automatize highly repetative operations on large documents. The situation is this: I have a technical text containing a lot of special characters, e.g. ❨ (U+2768) and ❩ (U+2769). The text is chiefly typeset in Cambria, but some of the special characters are not found in this font. However, I ...

Copy Table macro for Microsoft word 2007

Hi I have a simple requirement in MS Office word 2007 document. I needed code behind the macro which copies a Table (formatted one) and paste it everytime when I run this macro. The scenario is as follows:- 1. I will copy a formatted table (with 7-8 rows and 5-6 columns, etc) and store it in a macro as button or shortcut key. 1.Whenev...

Using a loop in Excel/VBS to populate a form

Please can somebody help me with the correct DIM statements and syntax to simplify the following into a DO UNTIL loop?: Sub DesRisk_Loader() Dim Qn(7) As String Dim Ys(7) As String Dim No(7) As String Dim Wk(7) As Integer Application.ScreenUpdating = False n = 1 x = 1 Do Application.Goto Reference:="DesHome" ActiveCell.Offset(x, ...

Access VBA equivalent to a C# List<T>

I have a COM-visible object written in C# that accepts a list of string arrays. Could I send a Collection of string arrays from Access 2000 to this object and it work? If not, then what is the best way to send multiple string arrays to my C# object from Access 2000? ...

how to Speed Up the VBA Macros

I am Generating a New Sheets using macros. For a New Sheet generation , Data is retrieved from more than 4 MS Access DB. Each DB had minimum 200 field. My Macro code includes 1. Cell locking 2. Alignment and formatting 3. One third of the cells in the sheet had a formulas 4. Cell reference with other Workbooks My problem is e...

Last cell selection .End(xlup) using VBA in Excel 2003 'lists' - requires two .Select to get correct cell?

Hi All! I'm a new convert from Experts-Exchange since I noticed they increased the 'Free Premium Services' points threshold. It seems that Excel 2003 has issues with the End(xlup) command when using it in a worksheet that contains an Excel 'List'.. If I select a cell outside the 'list' boundary, and then try to select the last cell in...

Access VBA - Append one property to multiple fields?

I'd like to append one field property to multiple newly-created fields, like this: Set Robo0 = RoboCallDB.CreateProperty("Format", dbText, "0") With RoboCallDB.TableDefs(sTableName) .Fields("Account").Properties.Append Robo0 .Fields("ServAddrPhone").Properties.Append Robo0 .Fields("CustWorkPhone").Properties.Append Robo0 ...

Converting STEP files to DWG by using autodesk Inventor and VBA

Hello, Does anyone know how to do that? My skills in using VBA aren't very good and I also googled for it, but I do not even know how to open one of those files by using VBA. Maybe someone of you did already do something like this before? Thanks a lot for any help. EDIT The following steps have to be done do convert the files: Op...

[ADO] Can't update recordset

I don't want to update data in DB. I just want to update data in the recordset to prepare the data to use. With RS .CursorLocation = adUseClient .Open "execute StoredProcedure", DBCon, adOpenStatic, adLockOptimistic Set .ActiveConnection = Nothing End With I was once able to call update method successfully with the code ab...

Execute code when form is closed in VBA (Excel 2007)

I would like to execute some code when a user closes a form using the x button in the top right corner of the window (I have the form load when the excel spreadsheet is opened, and it hides Excel. I want to exit excel once the form is closed, or at least show excel again so the user may exit it manually) Looking at the form properties, ...

Receving an error when calling WCF using a Service Moniker in Excel

I have a WCF webservice running that has 2 endpoints (mex and wsHttpBinding). The webservice is hostend on the address: http://localhost:2412/Service1.svc and its contact is named "WcfService1.IService1" I want to call this service from VBA in Excel. To that, I use the folowing code: mexMonikerString = "service:mexAddress='http://local...

How can I check the task status of an e-mail in an Outlook macro?

In Microsoft Outlook an e-mail be flagged for follow up which marks it as a task. I can check to see if an item is marked as a task with mail.IsMarkedAsTask. How can I find out the task status (open, complete, etc) of the email? ...