vba

How to debug a Bad DLL calling convention error in MSAccess VBA code

Hi, The title says it all I made some changes to a function in a module and then got the error. How do a debug it to find the cause? The error occurs on the Exit function statement of the function...great hey! Malcolm ...

How do I dynamically update the name of a worksheet in Excel?

Hi, I have an Excel spreadsheet which is being used to specify filesystem build information for our Unix team. This worksheet would have different information depending on the system to be built. For example, a production system would have many filesystems, whereas a development system only one or two. So based on user input, we woul...

Programmatically add 'Input' form

I'm looking to have a form generated automatically. The form would show two text boxes per account, and the account name would have to be displayed as well. The main problem is that there are a variable number of accounts to show, and that I would like a button to click to then copy the data in those text boxes to the worksheet once the ...

Openform action was canceled in MS-Access VBA code

Hi, I am supporting an application which was running for the past 3 years. It was developed completely in MS Access and written in VBA. Suddenly the application is facing the mentioned error at the following lines: DoCmd.OpenForm FormName:="frmNewPeerGroup", View:=acNormal, windowmode:=acWindowNormal, OpenArgs:=5 FrmNewPeerGroup cod...

I need to generate bookmarks in word 2003 programaticaly based on locations denoted by section number.

I have an HTML page with links that when clicked open to a specific bookmark in a word document. I am working with an existing word 2003 document with no preexisting bookmarks. I want to add bookmarks to all section number header locations using a macro or a VBA script . Example 3.1.4.2 HERE STUFF 3.1.4.2.1 Here again ...

Conditional Cell Contents on Grouping status

I'd like to have the value of a cell change if a specific set of grouped cells are hidden or not. Is there a worksheet change action for grouping and ungrouping cells? I can't seem to generate one with Macro Recorder; it doesn't seem to care if cells are hidden or unhidden in a group. Then, I can have a macro change the value of the cell...

Changing .Interior.ColorIndex has no effect

In Excel 2003, when I change Series.Interior.ColorIndex to a value I need, it has no effect. It has an effect only when I first manually change color and then run the macro. Apparently this triggers some update mechanism. Does anyone have an explanation for this? Is there a way to somehow trigger this in the chart?.. I.e. make sure that ...

Creating Word or XML document with VBA

I need to create documents, (~150 reports, letters) mostly from pre-existing snippets and local databases, with VBA, in Word 2003. I then need to change specific parts of those snippets, such as dates, phrases, user information, &c. There are also, obviously, some bits that I will generate in my program. Currently, this same task is don...

Recordset in VBA and C sharp

considering this code Dim cn As New ADODB.Connection, cn2 As New ADODB.Connection Dim rs As ADODB.Recordset Dim connString As String Dim SelectFieldName Set cn = CurrentProject.Connection SelectFieldName = astrField...

How to programmatically add a toolbar button (and OnClick handler) to Excel

How do I programmatically add a toolbar (with buttons on it) to Excel (2002 or later)? When the button is clicked I want a handler to create my COM object and call a method on it? ...

Reinitilise a range in Excel / VBA

Hello, In a macro, I'm applying the same treatment in each Worksheets of the file. I want to determine wich column contains a specfic text (might be different in each WS). For Each Cell_version In Ws.Range("1:1") If Ws.Range(convertir(Cell_version.Column) & "1") = "ICI" Then Column_version = convertir(Cell_version.Column) ...

Can ActiveX properties (to be accessed from Visual Basic) be procedurally generated at run-time?

Does anyone know if it is possible to generate ActiveX properties at run-time? I only need to be able to get and set these properties from Visual Basic. My ActiveX control is coded in C++ and I already know how to create properties by implementing hard-coded C++ get and put functions. However I have potentially a large set of prope...

How to get id of newly inserted record using Excel VBA?

Seems a common enough problem this, but most solutions refer to concatenating multiple SQL commands, something which I believe can't be done with ADO/VBA (I'll be glad to be shown wrong in this regard however). I currently insert my new record then run a select query using (I hope) enough fields to guarantee that only the newly inserted...

Macro to Insert Information Between Rows Repeatedly

I want to insert a list (below: generator, control tower, etc.) repeatedly throughout a spreadsheet. It should be inserted every other row (after each Turbine) and offset one column as shown below. I don't know how to write a macro to do this automatically. Any help is appreciated. TURBINE A-2 Generator Control Tower Brak...

For loop with non-contiguous range

I have a loop that runs through each column and sets the value to an R1C1 sum of a few rows above it. I'm using a for loop, but I want to skip a few columns, as they contain formulae already in the cell. How can I set up a loop that only cycles through a non-contiguous set or numbers? For reference, I want it to cycle through columns 1...

Reflection Terminal Emulator - Integration with IE

I'm trying to implement some integration between a legacy app running in the Reflection Terminal Emulator and a browser-based app running in IE. I'm using Host Initiated Scripts so that maintenance and deployment issues are isolated to the legacy app. All scripts will be generated in the legacy app and transmitted to Reflection using e...

VBA ListView Control

What is the fastest way to fill ListView from query when it has over 15000 lists with 9 subitems. it is taking me about 6 minute to load. Here is what I wrote to fill ListView control. Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly, dbReadOnly) With Me.listViewData .View = lvwReport .GridLines = True .FullRowSelect = ...

Programmatically access chart source data name

I have some charts I've copied over from an identical workbook, but the source data for each chart (42 charts, with 6 series in each) still contains the full filename path. The source sheet and cells are identical, so I just want to find the path string and replace it with "". However, I can't find a way to get the name of the sourcedata...

Why does my VBA project fail in other computers?

I made a VBA project based on Excel and Access. When I copied to other computers, some methods (left, right, etc) or controls (ComboBox) sometimes disabled. I had to rebuild in that computer. But sometimes it's OK. Why? Is that because of licence issues? ...

How to get Ribbon custom Tabs IDs?

Hi, I am working with a Custom Ribbon in Power Point, I need to iterate through all tabs and get the ID of them. The Ribbon contains Tabs added from different projects (C++, C#) as addins and I don't know their IDs. I am using VBA to handle the events fired from the Ribbon. How do I do to get the ID from all tabs in the Ribbon using VB...