Newbie_Movie
Registered User.
- Local time
- Today, 14:38
- Joined
- Jun 10, 2008
- Messages
- 23
Hello Everyone,
I want to try to make a button in Access which can open a specific sheet in a Excel-workbook.
The specific sheet must referer to the selection in a listbox. So the meaning is when i select an item in a listbox, the button must open the specific sheet of the item for an example a city.
The code that i have is:
Private Sub Button69_Click()
On Error GoTo Err_Button_Click
Dim xlWB As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Open("C:\worldcitys.xls")
Exit_Button69_Click:
Exit Sub
Err_Button69_Click:
MsgBox Err.Description
Resume Exit_Button_Click
End Sub
Can someone help me?
I want to try to make a button in Access which can open a specific sheet in a Excel-workbook.
The specific sheet must referer to the selection in a listbox. So the meaning is when i select an item in a listbox, the button must open the specific sheet of the item for an example a city.
The code that i have is:
Private Sub Button69_Click()
On Error GoTo Err_Button_Click
Dim xlWB As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Open("C:\worldcitys.xls")
Exit_Button69_Click:
Exit Sub
Err_Button69_Click:
MsgBox Err.Description
Resume Exit_Button_Click
End Sub
Can someone help me?