RunTime Error 91 Object Variable or With Blokc variable not set

jlyn123

New Member
Joined
Jan 24, 2018
Messages
45
Office Version
  1. 2016
Hello,

I am getting this error but I don't know what I am missing. I used this same code in another form and did not get this error?

Below is part of the code.

Dim IsCreated As Boolean
Dim i As Long
Dim PdfFile As String, Title As String, Payee As String
Dim xlObj As Excel.Application
Dim wkbk As Object
Dim strUser As String
Dim strAttachment As String
Dim OutlApp As Object
Dim acOutputxl As Object
Dim DoCmd As Object
Dim acExportQualityPrint As Object

DoCmd.OutputTo acOutputxl, "ExcelWorkbook(*.xlsx)", "C:\users" & strUser & "\desktop" & "ACH Transfers" & Format(Date, "mmddyy") & ".xlsx", False, "", , acExportQualityPrint
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
You still didnt add the slashes as advised in post 3 and 4.
I think the board keeps removing them. I have seen that happen before a handful of times. I think that the board confuses it for HTML code and keeps removing them.
 
Upvote 0

Forum statistics

Threads
1,215,419
Messages
6,124,798
Members
449,189
Latest member
kristinh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top