vba

Password hash function for Excel VBA

I need a function written in Excel VBA that will hash passwords using a standard algorithm such as SHA-1. Something with a simple interface like: Public Function CreateHash(Value As String) As String ... End Function The function needs to work on an XP workstation with Excel 2003 installed, but otherwise must use no third party compo...

MSWinsock.Winsock event handling in VisualBasic

I'm trying to handle Winsock_Connect event (Actually I need it in Excel macro) using the following code: Dim Winsock1 As Winsock 'Object type definition Sub Init() Set Winsock1 = CreateObject("MSWinsock.Winsock") 'Object initialization Winsock1.RemoteHost = "MyHost" Winsock1.RemotePort = "22" Winsock1.Connect Do Wh...

Is it possible to "autopopulate" fields in IE?

Hi all, the company I work for want to use a "hosted payment form" to charge our customers. A question came up on how we can populate the "payment form" automatically with information from one of our other system. We have no control over the hosed payment form, and we have to use IE. Is this possible at all? And if so, how can this be d...

Is it possible to send and store a Type reference in VB6/VBA?

I'm working on a VB6 application and I would like to send a Type as a reference and store it in another form. Is this possible? Sending it is no problem, I just use the ByRef keyword: public Sub SetStopToEdit(ByRef currentStop As StopType) But when I try to use Set to store currentStop in the recieving module I get the "Object requir...

VBA in PowerPoint

Could anyone recommend me a good online guide to PowerPoint VBA? Else, does anyone has advice on how to record a macro in PowerPoint? Thanks! ...

Capture right-click'd text on Outlook Message Content

I'd like to know if it's possible to capture the text when a user right-click's on an Outlook message, and then add items to the right-click menu depending on the type of text. This is an example of what I'd like to do. If there's a message (mail item) with the following content: "Hello, please call me at 555-8474 regarding item A1234...

How do you find Leapyear in VBA?

What is a good implementation of a IsLeapYear function in VBA? Edit: I ran the if-then and the DateSerial implementation with iterations wrapped in a timer, and the DateSerial was quicker on the average by 1-2 ms (5 runs of 300 iterations, with 1 average cell worksheet formula also working). ...

"Clicking" Command Button from other workbook

Hi I am trying to write a macro that would "click" a command button that is in another workbook.. Would that be possible? Without changing any of the code within that other workbook? Thanks a lot! ...

How do you determine Daylight Savings Time in VBA?

What function will let us know whether a date in VBA is in DST or not? ...

How do I get a range's address including the worksheet name, but not the workbook name, in Excel VBA?

If I have a Range object--for example, let's say it refers to cell A1 on a worksheet called Book1. So I know that calling Address() will get me a simple local reference: "$A$1". I know it can also be called as Address(External:=True) to get a reference including the workbook name and worksheet name: "[Book1]Sheet1!$A$1". What I want ...

How do you execute a dynamic SQL Query against MS Access 2003 via VBA?

Hello Everyone, This is a super basic question but I'm trying to execute a Query that I'm building via some form values against the MS Access database the form resides in. I don't think I need to go through ADO formally, but maybe I do. Anyway, some help would be appreciated. Sorry for being a n00b. ;) ...

How can I call a long-running external program from Excel / VBA?

What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally, A model dialog box that let's the user know that the process is executing. If the executable fails, the user should receive a notification. A timeout should be enforced. A cancel butto...

How to Round in MS Access, VBA

Whats the best way to round in VBA Access? My current method utilizes the Excel method Excel.WorksheetFunction.Round(... But I am looking for a means that does not rely on Excel. ...

Determining whether an object is a member of a collection in VBA

How do I determine whether an object is a member of a collection in VBA? Specifically, I need to find out whether a table definition is a member of the TableDefs collection. ...

Easiest and quickest way of Web enabling old VBA apps

Given an small Excel VBA app (single form, small amount of records saved in single worksheet) that runs quite happily locally on the workstation, what would be the easiest and quickest way of providing the same app on the web? Re-writing the app is an option but I thought it was worth checking if there was a quicker solution out there. ...

Capturing the Click event in an Excel spreadsheet

How can I capture the event in Excel when a user clicks on a cell. I want to be able to use this event to trigger some code to count how many times the user clicks on several different cells in a column. ...

How to capture the "Print" button from the menu bar in a macro

I have a sheet with a custom button on it from where I control the printing process. Now the user clicks on the menu bar's print icon and this produces an "undefined" output. How can I intercept this menu bar button? Thanks ...

VBA array sort function?

I'm looking for a decent sort implementation for arrays in VBA. A Quicksort would be preferred. Or any other sort algorithm other than bubble or merge would suffice. Please note that this is to work with MS Project 2003, so should avoid any of the Excel native functions and anything .net related. ...

How to filter a report object when saving through FileDialog in MS Access

I am attempting to save an rtf file using FileDialog and would like to filter using a where clause. This is what I have: Set dlgSave = FileDialog(msoFileDialogSaveAs) With dlgSave .Title = "Provide the place to save this file" .ButtonName = "Save As..." .InitialFileName = Me.cmbPickAReportToPrint.Value & "-" & Format(Date, "mmddyy...

Visio VBA function to see if there's a shape in front of/behind a shape

Is there a way in Visio VBA to see if there is a shape in front of or behind a shape in Visio? I imagine I could write something that checks the bounding box of each shape in a page to see if it occupies the same space as my shape. I'd rather use something built-in since checking each shape could take a long time as a drawing gets more ...