vba

How to get address of cell which calls a VBA Functions in a Excel sheet

Hi, Is there a function to get the address of a cell which call a VBA function ? I used "Application.ActiveCell.Address" , but found that this method is not a correct way to get the address of calling cell. e.g: If we have excel sheet with saved VBA functions, Once you reopen the sheet, the above method will not work. please help n...

How to get seconds since epoch (1/1/1970) in VBA?

How can I get seconds since epoch (1/1/1970) in VBA? ...

How to refer to shapes in Visio vba

How does one create specific shapes in microsoft visio that are selectable through the normal interface? I am looking for code like ActivePage.addShape(type: person, 100,100, 50,50) The msdn and visio help documentation comes across as a bit advanced for a beginner, but is it the case that one has to add a shape manually and then give i...

How can I use an optional array argument in a VBA procedure?

I've got a private procedure in a VBA script for MS Access: Private Sub drawLineDiagram(chartSpace As Variant, title As String, caption As String, x_val() As Variant, y_val() As Variant, Optional y_val2() As Variant = ????) As you see, I want to have an optional last parameter for an array of values. What kind of default parameter mu...

Web scraping in VBA and Excel

I'm looking to download data tables from websites into Excel and pull specific pieces of data into a separate worksheet to create a database. I'm having trouble parsing numbers that are imported into one cell in Excel. For example, the numbers "-7 -110" written exactly like that on the website are inputted into one cell in Excel as "=-...

Why does SaveAs Method throw error?

I have the following vba code is part of a larger script. The issue I am having is that that the SaveAs function continuously throws an error even though the Outlook message has been saved to a directory on the system. Inspection of the the Err object yields no results as everything is either blank or 0. Another weird issue is that whe...

VBS Script Help.

I managed to get this code from you guys here, thanks so much with a collegue of mine, I ran this code a few times and it seems to work but stops after a while due to protected files such as system files, "Permission Denied" and then the script just stops, is there a way to modify the code below so that it can handle such protected files...

Can I iterate through all Outlook emails in a folder including sub-folders?

I have a folder which contains a number of emails and sub-folders. Within those sub-folders are more emails. I'd like to write some VBA which will iterate through all emails in a certain folder, including those in any of the sub-folders. The idea is to extract the SenderEmailAddress and SenderName from every email and do something with ...

Excel AutoFill problem

Hi, I'm having problems with a VBA script. The function fills in a sheet with some formulas. It works fine most of the time, however when I run it on a larger data set... it crashes with: Run-time error '1004': AutoFill method of Range class failed The debugger points to the last AutoFill call. When I look at the sheet, it seems that t...

VBA: Get source code from website using wininet

So basically I have the following code: Dim myIE As InternetExplorer: Set myIE = New InternetExplorer myIE.Visible = True myIE.Navigate URL:="http://www.google.com" While myIE.Busy DoEvents 'wait until IE is done loading page. Wend How would I be able to get the source code of the page? And it'll be nice if someone can link me to...

Customize ComboBox in Microsoft Access

I am trying to create a form in Microsoft Access that has 2 ComboBoxes. The first ComboBox is populated with a SQL query that accesses a list of values from a table. The 2nd ComboBox is will also be populated with a SQL query, but the 2nd ComboBox SQL query takes a parameter. I want to use the text that is currently in the 1st ComboBo...

Webservice returned xml value into Excel

Hi, I connect to a web service, and it returns a IXMLDOMNodeList type variable. It looks as though the node list's item(0) contains the schema, and item(1) contains all the table data. How can I transfer this data into the excel spreadsheet? This is what it returns when I debug.print results.item(0).xml (results is the results of t...

Word Macro AutoOpen not running

Hi, I've got a Word document that contains an AutoOpen macro. It works fine until I upload it to out intranet for people to download. When some users opens it from the intranet, it opens an embedded instance of word within IE, the doucment opens but the AutoOpen does not run. If they download the document, then open it, it work correctl...

How do I use vba to make a new button in Powerpoint and how do I make a progress bar after I click on it?

Hello, I have some code that I execute when a slide show presentation begins but because it takes some time, I want to create a button in a Powerpoint toolbar to execute this code. So, I click on the button and after that I want to happear a progress bar! How can I use vba to create a new button in a Powerpoint toolbar and how can I m...

mapping user defined data type (VBA) to C++

Hi, Can somebody please tell me how to pass a VBA user defined type to a c++ (dll). I specially need to know how to handle string type of VBA in the dll. Thank You ...

[Excel] How can you retrieve a signature of function usable in Excel in VBA or a DLL ?

Hello, When you type a function and press CTRL + SHIFT + A, you get a completion in Excel for the rest of the arguments. For example, try to type, =SUM(, then press CTRL + SHIFT + A, and you will get the following: =sum(number1,number2,...) My question is: how do you retrieve this signature from either VBA or a XLL, such as you can i...

VBA "ThisWorkbook.Close" Does not close this workbook!

I'm Writing a VBA macro in excel that is supposed to open "fileB.xls" and then close immediately after it opens. Since we will be talking about 3 excel files I'll call the first one fileA. The code for the buttons on the userform for file A look like the following. Private Sub CommandButton2_Click() 'Code for Button in FileA ' ...

How to call sheet-specific macro from one Excel workbook in another?

I'm trying to call an Excel macro that's in another workbook. It's a sheet-specific macro, but the syntax given by Microsoft documentation and researching on the web, only gives a way to access a macro by workbook only. That syntax is: Application.Run ("testworkbook.xls!macroname") What I need to do is have a sheet reference in ther...

how do i multiply two cells by their names?

if one cell is called ALEX and the other is called ALEXALEX (instead of A1 and A2)., how do i multiply them such that i just enter a formula like C1 = AlEX * ALEXALEX instead of A1*A2? ...

How to make a progress bar in powerpoint vba?

How can I make a progress bar with PowerPoint VBA? It should be done as an animation on a slide. ...