I have tried following code to open an existing excel file. the code gets executed but the excel file does not appear on the monitor please help.
Dim xlTmp As Excel.Application
Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open "L:\FormsNRegisters\Accounts\Bill_Forms.xls"
Dim xlSht As Excel.Worksheet
Set xlSht = xlTmp.Sheets(1)

Recommended Answers

All 2 Replies

try this

Dim xlApp As Excel.Application
Dim xlWB1 As Excel.Workbook

Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlWB1 = xlApp.Workbooks.Open("L:\FormsNRegisters\Accounts\Bill_Forms.xls")

try this

Dim xlApp As Excel.Application
Dim xlWB1 As Excel.Workbook

Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlWB1 = xlApp.Workbooks.Open("L:\FormsNRegisters\Accounts\Bill_Forms.xls")

Thank u abu Taher. it works

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.