Visual Basic for Applications; a subset of Visual Basic used in all Microsoft Office applications. Consider using this tag together with the tag for the specific application in question.

learn more… | top users | synonyms

3
votes
0answers
75 views

How to create a Call Diagram for Excel macros?

I have an Excel file with multiple VBA-Macros. For documentation purposes I want to create a UML Call Diagram, or similar that represents which macro calls which other one. Is there a way to ...
3
votes
0answers
280 views

Excel VBA : SQL query handles error

I have SQL that I can use in Excel 2013 to get the info from the Access database and it works using the SQL directly in a connection, but now I want to run it from VBA instead so I can use some ...
2
votes
0answers
26 views

How to enable macros on an external hard-drive

I have an external hard-drive that I have mapped locally to the e:\ drive. There is a subfolder that contains Excel sheets with macros that I am unable to run. In File->Options->Trust ...
2
votes
0answers
77 views

Append values to Access table from Excel with ID autogenerated

I have an Access database with some tables which get updated daily with some values. I need the tables to have an ID field which is auto-generated when the other values of the table are imported from ...
2
votes
0answers
139 views

Have a different style set in different sections of the same Word document

I have a document "template" (not yet a template file type - I hope to create that as described below) for a report. The report is broken up into different sections: Letter to the Client Table of ...
2
votes
0answers
103 views

How can I sign an MS Word macro with a digital certificate from the local machine certificate store?

I am trying to find out how I can digitally sign a Microsoft Word macro using a valid 3rd party CA issued VBA code-signing certificate that is installed into the machine rather than the user ...
2
votes
0answers
47 views

VBA substitute for Microsoft Office RT?

I've been working on VBA-based applications for automating Excel and other MS Office applications. Now I'd like to expand to MS Office RT, but I've read that Office RT has no VBA support. Is there any ...
2
votes
0answers
99 views

How do I get an event to fire when the slide changes in PowerPoint?

I already know of two supposed fixes, which I will list below, along with the reason they don't work for me. The first is to use the SlideShowNextSlide subroutine. The problem with this is that it ...
2
votes
0answers
200 views

Excel VBA not working when “enable editing”

I'm not sure if this is the right place to post this but I'm having issues with excel VBA. I sent a worksheet with custom VBA attached to an email. Once the user downloads the file, it open in excel ...
2
votes
0answers
2k views

How do I make Outlook 2010 print attachments automatically?

I'm trying to get Outlook 2010 to print attachments automatically apon arrival. I've found this on the internet. The VBA code is Sub LSPrint(Item As Outlook.MailItem) On Error GoTo OError ...
1
vote
0answers
18 views

Automatically Printscreen from result of formula

I have a procedure in VBA to call a PrintScreen: Sub PrintScreen() keybd_event VK_SNAPSHOT, 1, 0, 0 End Sub I want to call it every ten seconds, when the result of this cell ...
1
vote
0answers
65 views

How to change Control-Y behavior in Excel-VBA's IDE

Excel VBA's IDE register's a Control-y as "cut this line of code". By contrast, redo-ing is accomplished by Alt-e, R. Is there any way to change this behavior and make Control-y be the much more ...
1
vote
0answers
117 views

Excel VBA that calls Powershell ActiveDirectory cmdlet, but Module won't load?

I have a powershell script I use to dump user and computer lists to csv files; it works great and I don't want to touch it much. It uses the ActiveDirectory cmdlet, and the Get-ADComputer and ...
1
vote
0answers
62 views

MS Word 2010 - How do I create a universal macro that will auto-insert a header if none exists?

I'd like to create a macro enabled template that will automatically insert a header into a document if none exists. This is in order to work around a printing issue that cuts off the top of the ...
1
vote
0answers
45 views

Link Microsoft Excel to Word document

I need to link certain numbers in my word document to an excel file that I have. For example, the Revenue for FY2014 is "20,000". I would like the 20,000 to be linked to a certain cell in an excel ...
1
vote
0answers
38 views

Verify word document by vbscripting

Do you think vba will help me learn how to verify a word document by vbscripting. Or I have to strictly learn vb scripting for word documents. My main problem is I want to start verifying from line 7 ...
1
vote
0answers
21 views

Incomplete ListViews for CrossReference

I am using Word 2010 and have to often insert cross-references. Items to be cross-referenced are mostly table numbers and figure numbers, such as Talbe 1-2 or Figures 2-4. They always include chapter ...
1
vote
0answers
346 views

Reset Numbered List with Text Style VBA macro MS Word

I'm trying to make a VBA macro to create a Word document from Excel... Currently I'm having issues with setting up the Lists properly. I want the list indexes linked to my 2 header types. Like so: ...
1
vote
0answers
237 views

run-time error 1004 Application Defined or object-define error

I have this macro that I wrote: Dim lastColumn As Long lastColumns = wkbWorkbook2.Worksheets(2).Cells(1, Columns.Count).End(xlToLeft).Column 'this is the highlighted part in debug SourceRange.Copy ...
1
vote
0answers
59 views

Windows (partially) claims I have a private key for a foreign certificate

We have a MS Word document template with vba code produced and signed by an external firm. When I view the details of the signing certificate from within Word vba developer tools, it shows up with ...
1
vote
0answers
55 views

Why doesn´t my Outlook rule work more then once?

I´ve recently migrated my email to an exchangeserver, with my previous email set as a forward to my current one. I´m using outlook 2010 and Samsung galaxy s5. First problem at hand: Some E-mails ...
1
vote
0answers
284 views

Transferring Data Between Workbooks Based on a Value in a Specific Cell

I have created a form in Excel that moves information entered in the form to the adjacent sheet in the same workbook as well as my agents workbook at a different file path. That piece of the puzzle is ...
1
vote
0answers
108 views

Weird Excel 2010 VBA Window Behaviour

If I open Excel and then open the VBA window then close it, every time I RDP to my computer, the VBA window is open again, even if I closed it before disconnecting. The next time I am sat locally to ...
1
vote
0answers
82 views

MS Word 2010 macro to renumber pages within the footer of all sections.

My problems is that I also have a divider page which originally I provided -1 in the page field to get the appropriate count. Could you please advise how I can manipulate the macro to take this back ...
1
vote
0answers
83 views

From outlook RSS: Download attachment, rename the file and save it to a folder

I know that it should be possible but can someone give me a script to do this? At least some hints how to do it is appreciated.
1
vote
0answers
584 views

Splitting an excel 2010 spreadsheet into multiple workbook files based on column value

I find and clean a lot of contact data, sorted by country, which I am currently using excel to manage. Mainly because it is easier to clean and manipulate the data I find this way, and I can easily ...
1
vote
0answers
132 views

Is there a macro to filter table by some list elements?

I have a table with entries based on a list and I used a macro I found somewhere to be able to add/remove multiple elements from the list to one cell, let me show you an example: TEST TABLE test1 ...
1
vote
0answers
96 views

How can I edit this macro to loop through the results?

I am trying to select one cell to the left and to the right of a cell I have found by it's value. I am new at writing VBA macros and have hacked together the following script from a few different ...
1
vote
0answers
231 views

Incrementing ticket numbers each time I print

I have an excel sheet to print a set of 4 tickets per page which we use for stock takes. I found code that prints one number per page. Being a Visual Basic for Applications novice, I was unable to ...
1
vote
0answers
215 views

Microsoft Outlook 2010 - moving emails with specific number in subject to a specific folder with the corresponding number

I get emails in shared inbox containing a number in the subject (like 9921635). These emails are archived to subfolders, which are part of the shared inbox, that also contain this number. Sometimes ...
1
vote
0answers
251 views

Microsoft Excel Copy one row to another worksheet if cell contains specific data

I have never written a macro in excel before. I am trying to organize my PTAs spirit wear orders for ease of placing the order. I have entered all orders into a master worksheet titled "spirit wear". ...
1
vote
0answers
407 views

Outlook VBA script - find and replace text with image

I have a e-commerce store. When I get a sale, I receive an order confirmation email which contains the name of the product sold. When the email comes through, I would like to run a script that ...
1
vote
0answers
330 views

Macro to copy and insert rows by variable number

I have an Excel 2003 worksheet with names and addresses, unique per row, to be used for shipping monthly magazines. Some members receive more than one copy of the magazine, which will be indicated in ...
1
vote
0answers
195 views

Pasting and re-sizing a screenshot

I often take screen shots of random drawings and i want to re-size them using a macro. I want the macro to automatically paste the screenshot then re-size it to fit to a height of 5.9 inches and a ...
1
vote
0answers
546 views

Can VBA be used to get the creation/modified date of attachment itself, not the email?

I would like to see the creation and modified dates of an Outlook attachment using VBA. No such property seems to exist. Public myAhmt As Attachment Public crDt As date crDt = myAhmt.CreationDate 'no ...
1
vote
0answers
698 views

How to change the default language for all slides in a PowerPoint presentation?

I tried the trick explained in a related discussion, but could not change the proofing language for all texts in all slides of a PowerPoint 2007 presentation. Could this be a feature of PowerPoint ...
1
vote
0answers
4k views

Missing macros in Word 365

I'm hoping someone can help with this problem. I've just upgraded from preview to Office 365 and the problem is present in both versions (but not in the Office 2010 that I was using before). Whenever ...
1
vote
0answers
262 views

Runnning macro when specific text is entered on Word

How can I make a macro that does something whenever a specific text is entered on Word. Can you give me a simple example of a macro that, for instance, is run every time some text is entered between ...
1
vote
0answers
75 views

How to assign a standard email account to contacts in Microsoft Outlook

I am using Microsoft Outlook 2003 with 6 different POP3 accounts. Now I would like to define a standard account to be used for my contacts or groups of contacts, for example: When sending email to ...
1
vote
0answers
982 views

How to Search For Excel (2003) Files which Contain Macros on Server?

How can I search for Excel files that contain VBA code, are there any efficient ways to do this? The way I'm thinking of would be to use vbscript and recursively search through the directory, open ...
1
vote
0answers
107 views

Outlook 2010 Category search

I am looking for a script for Outlook 2010 Categories that will act like Evernote tags. Once you start typing in a search bar it will start displaying the categories that match. Is there something ...
1
vote
0answers
185 views

How do I connect a checkbox to include more than one cell of data?

I'm working on a matrix where you can compare products and their options to one another. I've created a macro linked to a data table in my workbook (titled portables). When you click the check boxes ...
1
vote
0answers
640 views

Switch IE9 browser mode to IE7 at runtime in VBA

I want to switch the IE9 Browser mode to IE7 programmatically in VBA at runtime. I can engage the F12 develop tools and change it manually, but I want to automate this step in my code after I have ...
1
vote
0answers
489 views

Refreshing Crystal Reports through Excel Macro

At work we have an ancient Ingress database that wont allow me to make links between tables using the SQL Query editor in Excel 2007. My current solution is to generate the data in Crystal Reports, ...
1
vote
0answers
624 views

Auto filter refuses to work in locked sheet in Excel 2010

I have a spreadsheet that is used for configuring IP phone system configurations. Bascially I have a table that has the following info in it; Part No. Description Qty Price I ...
1
vote
0answers
728 views

Excel 2010 AddPicture functionality changed?

Me again. In Excel 2003, we're using some VBA to automate adding a picture to a worksheet. The call, in a nutshell, is: Dim Pic as Object Dim filePath as String . . . Set Pic = ...
0
votes
0answers
8 views

Macro to reference tagged objects on other slides

I am wondering if there is a macro that could automatically update slide references for objects on other slides. For instance, let’s say there is a table on slide 20. I want to be able to place a text ...
0
votes
0answers
22 views

Excel 2010 Macro throws Object or Method Not Supported error

I keep getting an error 438: Object doesn't support this property or method when trying to run a portion of a macro I have that updates three PivotCharts off of the top three items on another table. ...
0
votes
0answers
23 views

Word (Office 365) macros disappear

I have created a few simple macros in Word. One of them allows me to switch between printers without multiple clicks. I create this macro (and other simple ones) and they work. The next day, the ...
0
votes
0answers
27 views

Use VBA to reset style inheritance (Word 2013)

I would like to revisit this question - Remove setting from style to inherit setting from base style - since the answer provided and voted doesn't really do what I want it to do. A style in Word can ...