chandrashekar
Well-known Member
- Joined
- Jul 15, 2005
- Messages
- 529
- Office Version
- 365
- Platform
- 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
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