vba

VBA user function: Bad for argument name and submitted variable name to match?

Note the argument of the function is named strToothpaste. When the function is called, the variable that's passed in uses the same name. Private Sub DoThis() Dim strToothpaste as String Dim booSmellsFunny as Boolean booSmellsFunny = fnc_Fragrance(strToothpaste) End Sub -------------------------- Private Function fnc_Fragrance(s...

vba Extentiblity, com addin guidance?

Does anyone know of good reference material for creating a com addin for the VBA Editor enviroment, i know its exactly the same as writing a com addin for common enviroments using the addin model provided by microsoft using the IDTExtensibility2 interface. just registering the com registry keys to a different location, Where is that loca...

Newbie: should I learn c#, VB.Net or VBA/VB for excel programming?

My background: Mostly C programming. I have some (very recently...last 2 months) acquired JAVA (novice) skills. All my limited experience is based on developing for linux. I would like to do some excel programming for work purposes. My main interest is in starting to create "dashboards" and charts/reporting from excel sheets as I'm sick...

Access VBA How to add new sheets to excel?

Hi, I am running a few modules of code in access and am writing data into Excel. When I write the first time, data gets written properly. But again when I try, the new data is written on top of the old data. What should I do to insert a new sheet? My existing code is Dim objexcel As Excel.Application Dim wbexcel As Excel.Workbook D...

must capture document properties for word, excel and powerpoint documents

Hi, I am new to VBA and this area. I would like to capture the document proporties like (document title, subject, author, team, manager,company etc...) while create or saving the document. This properties capture is must and i would like to implement to all the Word, Excel, Powerpoint users in my company. How this can be possible...

VBA error with modules: 'can't find the module'

...

MS Access 03 - Query Expression to Add like ID Numbers

So I have a query that is a Top Nth aggregate query, and I have another query built from that one that returns all the offices/locations grouped for each of the top sales. I want to make a report that counts the number of offices associated with each of these top Nth ID values that are returned in this query. I want to use a domain aggre...

Calendar Control 12.0 Refuses Input

In Microsoft Access, I have a series of forms that require the user to specify a date range. Right now I do this with Calendar Control 12.0. However, at random times, the control refuses to accept any user input (such as changing the date). Why would the Calendar Control refuse input? Is there any known workaround for this? I'm runn...

Bug in Word 2007 ConditionalStyle

I'm using the Word 2007 object model to manipulate tables. Whenever I read the Shading or Borders properties of a ConditionalStyle object for a table's style (using VBA or C#), it resets the table's applied conditional styles to Header Row, Banded Rows, and First Column, and it clears all table-level formatting (borders and shading). ...

How to import the content of MS Access Database into combo box of Excel?

I have a simple MS Access database with the following design: |Last Name | First Name | Country | And I have a combo box on Excel. I would like to list down all the Last Name and First Name from MyDatabase into combo box with the following format: $LastName, $FirstName I hope anyone could help me regarding this matter. Your respons...

Operation must use an updatable query. (Error 3073) Microsoft Access

I have written this query: UPDATE tbl_stock1 SET tbl_stock1.weight1 = ( select (b.weight1 - c.weight_in_gram) as temp from tbl_stock1 as b, tbl_sales_item as c where b.item_submodel_id = c.item_submodel_id and b.item_submodel_id = tbl_stock1.item_submodel_id and b.status <> 'D' ...

Remove paragraph mark when copying from excel cell

Please help me copy a string from a listbox when a user hits ctrl+c. I was using the dataobject but for some reason this worked perfectly some times and gave me an error message other times. If you know why this is, stop reading, as the rest of this question is not necessary. Now I am putting this in a worksheet cell and using range.cop...

Duplicate named ranges between workbooks causes my custom functions to get confused

I am a bit confused about scope of named ranges in Excel. I have two versions of an excel workbook. Occasionally, the users need to copy data from an older version of the workbook into a newer version. There are some custom VBA functions used in most of the cell calculations. Each of those functions looks up around 4 to 12 named rang...

Import from csv to ms access tables using macro

Can some provide me a VBA macro to import data from a CSV file into ms access tables ? ...

VBA fuction to alert when value changed with in a time frame

I have a excel cell where its value is updated every minute. What i need is a alert message box; while that cell value moves to a particular time. Suppose a cell has value 10 if it reaches 7 in one minute .. i need a message box to alert that. if it is not reaching 7 in one minute its not needed to be alerted. Please help to write...

How can I use a VB6 COM 'reference' in IronPython?

Hello. I'm currently developing what is more or less a script that needs to get some data from a VB 6 COM dll. This dll is currently used in a MS Word VBA project, and it exports classes, etc to the VBA code. It is added in the Tools -> References menu in the VBA editor, and I can see it's classes in the object browser of VBA. From my ...

Update calling all rows if clause in vba

i am writing a macro to convert the zeros in the access table to "0000" Zero is text data type so i cast it to int in the if condition to update the records which is only zeros and preventing it in updating records which are non zeros but now all the records are getting updated ..if clause is calling all the time even there is a value...

Excel mouse focus weirdness

I have a class based on CSocket in a DLL which has various threaded buffers for holding the incoming stream. I have a couple of applications with which this works perfectly, using a timer to poll the buffer to see if anything is there to be pulled out and then displayed. Now I've got the timer in some VBA code, a macro if you will, in a...

How to use the "Locals" window in VBA IDE

When I'm coding VBA in Access 2003, I keep the Immediate window visible and I use Debug.Print and Stop to solve my challenges. But I've never known how to get help from the "Locals" window. I understand what's in there for the most part. But it usually seems like I'd have to dig around for the item I want, and it could take a while to...

MS Access Freezes Up After Text Import

I have the following code to import a delimited file into an Access 2003 database: Public Function importTextFile(sFile As String, _ sTable As String, _ sSpecification As String) On Error GoTo importTextFile_EH ' Validate arguments to see if the objects exist; if not, giv...