Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Excel Workbook 1

Status
Not open for further replies.

lbigk

MIS
May 24, 2002
58
US
Hi, I have a simple code to open Excel Workbook:

Private Sub cmdDataClean_Click()
Dim dbs As Database
Set dbs = CurrentDb
Dim xlExcel As Object
Set xlExcel = CreateObject("Excel.Application")
Dim fnstr As String
fnstr = "C:\" & Me.txtFileName
xlExcel.Workbooks.Open (fnstr)
End Sub

The code runs without any issues, but the Excel file is not visible. If I try to open it directly from C drive, I get a notification that the file is already open. How can I view it?
 
Add the following line in your code:
xlExcel.Visible = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top