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

4
votes
0answers
516 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
43 views

Outlook 2013 VBA Editor Launches Without Displaying Debug and Edit Toolbars

Just an annoyance, but I've hunted through every editor command option to no avail. Just switched laptops, and in my old VBA editor it launched each time with no code windows open and the debug and ...
2
votes
0answers
275 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
223 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
54 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
173 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
306 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
298 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 ...
2
votes
0answers
3k 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 ...
2
votes
0answers
573 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 ...
2
votes
0answers
945 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 ...
2
votes
0answers
319 views

How can I create a Search folder that contains multiple object types in Outlook 2007 from a secondary mailbox?

I added an additional mailbox to my account. I want to create a view that is similar to the 'to do list' view that exists for that user. This means I want a search folder that searches that mailbox ...
1
vote
0answers
16 views

How can I set Microsoft Word up to change any text encapsulated in `backticks` to monospace?

I wish to be able to type `simple code` in between backticks as shown, and have Word automatically change the font to some monospace variant. I am aware of alternatives such as LaTeX, but would like ...
1
vote
0answers
29 views

Not all docVariable fields updating

In Word 2010 have created a userform for a document at work, allowing for information to be entered that is then input into the document repeatedly throughout. I'm using docVariable fields to achieve ...
1
vote
0answers
64 views

Programmatically rotate a pie chart to fix the labels

Part 1 I'm looking at a way to automatically rotate (with VBA) a pie chart depending on the data. The data is changed dynamically depending on the month selected. Here is an example of the kind of ...
1
vote
0answers
45 views

Regex to find commas, excluding commas inside a string demarcated by double quotes

I would like to manipulate a closed .csv file without opening it through a button on an Excel AddIn. I am able to complete all the steps but am having a problem with finding a regex that would ...
1
vote
0answers
28 views

Extract Webdata from Microsoft word

I want to extract data from specific website into word I have table containig hyperliks I want to extract some data from that link to next cell in word Is it possible to copy html from or in ...
1
vote
0answers
48 views

Can MS Access make a column-of-rows type of form like the one pictured?

I am trying to make a form consisting of multiple forms stacked side-by-side in Access, like the one pictured below but have run into many, many issues. I will settle for a report if I can't get a ...
1
vote
0answers
34 views

VBA is disabled in Excel Home and Student 2010 (on XP SP3)

Everything seems to be working fine with Office, except that in Excel the VBA/Macro functionality is disabled. I cannot launch the editor, all macro-enabled files are interpreted as corrupt and the ...
1
vote
0answers
24 views

Control Number Generation

So currently I have the following. When I click a button or hit submit button The form looks on the Ledger Tab. I was trying to get the form to automatically generate a control number (ConNum) that ...
1
vote
0answers
33 views

Cell with 2 options and I want to add a third

So I have this excel file where when i select a particular cell a little box with an upside down triangle appears to the right of the cell. When I click on this there is a small list of options to ...
1
vote
0answers
53 views

How can I ensure that a formula that I have written to calculate the difference between time values applies only to the filtered values?

I have two columns of data: Member Time A 09/24/2015 09:48:36 A 09/24/2015 09:47:40 A 09/24/2015 10:11:06 A 09/24/2015 10:08:47 B 09/24/2015 10:28:45 B ...
1
vote
0answers
70 views

How to use Selection.Paragraphs.Count in Word to repeat a process X number of times

I select X number of paragraphs in Word and want to activate a macro that performs the same action on each paragraph. The action is adding a style separator before the first period in each paragraph ...
1
vote
0answers
43 views

Outlook 2010 - setting a rule for an incoming mail (read or unread)

I need a little advice on Outlook 2010. There is this situation: - one webmail account which is used by a several people (using web browser or phone to access it) - one computer with MS Outlook 2010 ...
1
vote
0answers
258 views

“Microsoft Excel is waiting for another application to complete an OLE action” interrupting VBA code

I've got an Excel workbook that is running some VBA code, which I use every day. During execution, it keeps hanging on a dialog box saying "Microsoft Excel is waiting for another application to ...
1
vote
0answers
47 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
86 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
54 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
50 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
46 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
319 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
67 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
81 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
462 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
150 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
105 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
119 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
114 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
355 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
295 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
392 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
307 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
731 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
5k 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
316 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
77 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
1k 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
112 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
195 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
699 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 ...