vba

Packaging Add-Ins in DLLs

I have two MS Office add-ins written in VBA that I would like to package into an installer, along with some support files. Since VB passwords protecting add-in code can be hacked pretty easily, I want to "convert" the VBA code in my add-ins to DLLs, then call the DLLs from the add-ins. What are my options for "putting" VBA code in DLLs...

Is it possible to use Excel/Access to consume a SOAP based web service using WS-Security?

The extent of my ability is in vba and asp. I'm interested in consuming a SOAP web service from Excel or Access, mostly because it's easier for me. I've also got the wsdls for the web service which is using ws-security. Is this even possible? From what I've read, .net is my logical option, but there's obviously a gap in my skill. Is...

Excel VBA App stops spontaneously with message "Code execution has been halted"

Hi, From what I can see on the web, this is a fairly common complaint, but answers seem to be rarer. The problem is this: We have a number of Excel VBA apps which work perfectly on a number of users' machines. However on one machine they stop on certain lines of code. It is always the same lines, but those lines seem to have nothing in...

Searching two columns and returning value from third VBA

Hello, A colleague of mine has an excel spreadsheet made up of 3 columns and would like to make searching them easier. What he has is two cells off to one side that he enters a value from column one into and a value from column two into. What he would like to do is search the spreadsheet for instances where value one and two exist in ...

What's the fastest way to check the availability of a SQL Server server?

I have an MS Access program in use in multiple locations. It connects to MS SQL Server tables, but the server name is different in each location. I am looking for the fastest way to test for the existence of a server. The code I am currently using looks like this: ShellWait "sc \\" & ServerName & " qdescription MSSQLSERVER > " & Qt(f...

VBA Access Import Specification strange error

I am trying to import a text file into Access using a saved "Import Specification" in my access database using VBA. The import generates the Import Error table showing the errors in the last two fields. BUT if I use the same import specification manually to import the text file, the Import works perfect !!!!! Strange ..... why would th...

How do I get a single file name out of a File Dialog object in VBA (for MS Access 2007)?

How do I change my code to get the file name instead of the directory name? openDialog.InitialFilename gives me the directory name. openDialog.FileName gives me the error "Method or data member not found". Private Sub btnEditPhoto_Click() If (txtImageName > "") Then Application.FollowHyperlink txtImageName Else ...

What are the benefits of using Classes in VBA?

Hi All! I am doing some VBA programming in excel 2007 and have one workbook where all the datasheets is to be copied from, into another sheet. The new sheet will have several header rows, and I would like to keep track of where they are situated so I don't have to find words in them constantly. Is the simplest thing to use classes and...

Excel Macro: How do I copy all rows from 3 worksheets and merge rows that are unique in the first column?

The worksheets have hundreds of rows with account numbers in column A, an account description in column B and totals in column C. I want to copy the rows from all 3 worksheets into a single 4th worksheet but where duplicate account numbers are found, I want there just to be one with the totals aggregated into column C of that row and the...

Is it possible to exclude hidden rows when searching for duplicates in Excel?

I am working on a procedure in Excel using VBA that highlights duplicate rows. The procedure evaluates the result of the worksheet function sumproduct to determine if the row has duplicates. The evaluated formula ends up looking like this: SUMPRODUCT(--(A1:A10 = A1), --(B1:B10 = B1), --(C1:C10 = C1)) So far the procedure works great,...

VBA Access Specify Field Format for a Date/Time Field

I am having issues with changing the Field Format of a existing Data/Time Field. I want to add a field called "Duration" to a table called "IncidentData" and change the field to show only the hour and minutes information such as "13:44" ...

Userform Cancel Button _Intermittently_ Unresponsive?

The attached VBA procedures are for a progress bar userform. Everything works as expected, except that the cancel button is intermittently unresponsive. I say intermittently because, 95% of the time I have to click the cancel button numerous times before the procedure stops. I can see the button click event being animated, but the proce...

What's the best language to automate this Windows task involving Outlook and Excel?

Hi, I need to automate a particular task that involves: Fetching mails from my mailbox based on a set of criteria - from a particular user, has a particular pattern of subject line, etc. Parsing the mail body of each mail and extracting some content (the mails have an almost fixed pattern) Creating an Excel sheet with a particular te...

Is it better to show ProgressBar UserForms in VBA as modal or modeless?

Is it better to show ProgressBar UserForms in VBA as modal or modeless? What are the best practices for developing progress indicators in VBA? Modeless UserForms require the use of Application.Interactive = False, whereas Modal UserForms by their very nature block any interaction with the application until the core procedure has finishe...

Remove Text from textbox in VBA when the form reruns

I have a form in witch i have some textboxs. After i complet the textboxt i check a few checkbox and hit the start button it writes something in a file and it restarts but it keeps my old text and checks. I want a simple comand to remove the text and checks; i want it to restart my form like it never ran ...

[Excel VBA]How to cast a shape object?

I want to assign a ComboBox control to a class member of ComboBox type. This control is in a group on a worksheet. The problem is through GroupItems property, I can only get a Shape object, not a ComboBox. So when assigning, it alerts "type dismatch". If the control was not in a group, I could get an OLEObject object through OLEObjects...

Excel VBA worksheet.names vs worksheet.range

Hi There The question I have is a quick one to do with the VBA object model. I have created a defined name/range on a worksheet called "bob", pointing to a single cell. I have a bunch of other name/ranges set up on this worksheet, which I didn't create. All the other ones work perfectly. The new one created by me does not work perfectly...

Excel VBA: Copy rows from another workbook, but just the function results

I want to copy 10 rows from a workbook into a new workbook. The copy & paste is fine, but in the copied cells are some formulas that I need to replace with the results. Is there a magical way to copy only the displayed values from the cells? This is how I do it now: Rows("2:11").Select Selection.Copy myWorkbook.Sheets(1).Activate Acti...

Excel VBA: Help with deleting cells based on conditions

I have a new job (yay!) which includes a chunk of Excel work that I have to do. I am new to Excel programming, so I am planning on picking up a book or two to start learning. But, in the meantime, I already have tasks to do, so I was hoping that someone would be able to help. I need help programming a little task with VBA. I have a list...

VBA basic script for reading xml data?? Resource for learning this method??

So I was just looking for basic examples of reading xml structure data with visual basic subs/scripts. specifically, if possible, how can i take structure data of xml, read the data with some vba, and lay it into excel spreadsheets? or just a learning resource for this type of thing. thanks very much! ...