Category "vba"

How to capture the MessageID of an email that was just sent in Outlook using VBA

I generate an email in vba and send it. I have a class which includes the send event for that email so I am able to tell if the email has been sent. My issue is

Check if dynamic array is initialized or contains value - VBA Excel

Is there a way to tell if some dynamic array, for example arr() as String is initialized? IsEmpty and IsNothing seems not to work with dynamic arrays. Currently

.SendUsingAccount selection for .onmicrosoft.com custom domain account

I set up a custom domain for my Microsoft 365 business account ("@company.com" is the custom domain which is really "@company.onmicrosoft.com"). I have two othe

if range of cells contains string then goto

I know this is a topic that is talks about a lot, but I just cant find the answer. I have a range. if in that range there is a word then I need it to go to the

Search string syntax for Restrict method

I'm trying to pull a set of five emails from a specified Outlook folder based on two conditions - the (partial) subject line, and received between two specified

How can I reset recurring meeting in vba?

I wrote vba script to duplication my main calendar to another calendar, including recurring meeting. All is well except when the organizer do out-of-order modif

Filter Pivot Table based on clicked cell text

My workbook consists of 2 sheets: Sheet1 is the primary dashboard that the user sees, while Sheet2 consists of a pivot table and regular table. I'd like to imp

Copy data to another spreadsheet based off value stored in string

I have the below code for one of my financial reports and I'm struggling with updating the code to make it more automated. The code creates a string of the colu

How to use Xlwings RunPython for file name with spaces

I am trying to run a python function called comments() from vba and getting an error with the following code due to spaces in the file name: Sub notes() Dim f

Outlook Redemption error in MS Access: ActiveX component can't create object

Code: Dim Application As Object, namespace As Object Set Application = CreateObject("Outlook.Application") Set namespace = Application.GetNamespace

How to reorder Outlook PST mailbox/store in folder pane?

I'm using Outlook 2016 and I have two PST files listed below my default Exchange mailbox/store. In the Folder Pane, I can click and drag the PST mailbox/store a

How to generate multiple json in vertical column in Excel VBA?

Using excel macro The first line is the json file name, and the second and subsequent columns are the values. With the first column as the key to the json obj

Comparing two rows according to specific string

So i've been trying to wrap my head around this for weeks now and have tried many things but nothing that works for my case, I have two sheets with "similar" St

How to write code to test a cell for specific data, and if that data is present, don't run the macro. If not present, then run macro?

I am trying to test a cell for specific data. If it contains that data, I do not want my code to run (because that would leave my worksheet and workbook Unprote

Creating an Array from a Range in VBA

I'm having a seemingly basic problem but can't find any resources addressing it. Simply put, I just want to load the contents of a Range of cells (all one colu

Opening a file throws error: "Cannot find project or library"

I have an Excel file that uses VBA to calculate active ranges for a few sheets to make a .csv file to be picked up by a reporting server. Every once in a while,

How to Give 'PickFolder' dialogue a title

I'm writing some code in which the user will need to pick both a source folder and destination folder using: Set SourceFolder = GetObject("", "Outlook.Applicat

Send by mail Excel sheet image

I have an Excel with an embedded image. How can I send it by mail using the name of the image? I do not want to send it attached, I want to embed it in the htm

How do I change the 'From' value of mail failure items?

I'm exporting/extracting mail failure items located in a subfolder named 'Subfolder' to a local folder on my laptop using this Outlook code: Private Sub DBC1()

How can a run a script rule be reset after it stops working?

I cobbled together a script and rule to save incoming emails as .txt files on our server. It works for about a day or two, but then stops working until I delete