Subscript out of range - Outlook

chandrashekar

Well-known Member
Joined
Jul 15, 2005
Messages
529
Office Version
  1. 365
Platform
  1. Windows
Hello,

am trying to open excel from outlook but its giving Subscript out of range error in the below code. Could you please help on this.

Thanks in advance.

Function Client_list(ByRef subj As Variant, ByRef path As Variant)
'Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Set appExcel = Nothing
Set appExcel = CreateObject("Excel.Application")
subj = subj
clientpath = "D:\MSEN Report Automation\Client List.xlsx"
filefound = Dir(clientpath)
FileName = filefound
If filefound <> "" Then
'On Error Resume Next
'name1 = appExcel.ActiveWorkbook.Name
Set wrkbk = appExcel.Workbooks("Client List.xlsx")
appExcel.wrkbk.Open clientpath
appExcel.Visible = True
Workbooks(FileName).Activate
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,225,750
Messages
6,186,805
Members
453,373
Latest member
Ereha

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