Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Excel from access
I have not been able to figure out how to open a specific
excel workbook from access and have it be the active screen. If anyone has any ideas I would greatly appreciate it. Thanks, John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Excel from access
Try this in Access
Sub test() On Error Resume Next Set xl = GetObject(, "Excel.Application") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application") xl.workbooks.Open "C:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "John" wrote in message ... I have not been able to figure out how to open a specific excel workbook from access and have it be the active screen. If anyone has any ideas I would greatly appreciate it. Thanks, John |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Excel from access
Dear Ron,
The code did not work, it did not understand this part of the code: AppActivate "Microsoft Excel" If you have any other suggestions that would be great. Thanks again, John -----Original Message----- Try this in Access Sub test() On Error Resume Next Set xl = GetObject(, "Excel.Application") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application") xl.workbooks.Open "C:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Excel from access
Try it with the version number in the code like this
10 =2002 9=2000 Sub test() On Error Resume Next Set xl = GetObject(, "Excel.Application.10") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application.10") xl.workbooks.Open "C:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "John" wrote in message ... Dear Ron, The code did not work, it did not understand this part of the code: AppActivate "Microsoft Excel" If you have any other suggestions that would be great. Thanks again, John -----Original Message----- Try this in Access Sub test() On Error Resume Next Set xl = GetObject(, "Excel.Application") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application") xl.workbooks.Open "C:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Excel from access
See this page also
http://www.erlandsendata.no/english/...php?t=envbaole -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ron de Bruin" wrote in message ... Try it with the version number in the code like this 10 =2002 9=2000 Sub test() On Error Resume Next Set xl = GetObject(, "Excel.Application.10") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application.10") xl.workbooks.Open "C:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "John" wrote in message ... Dear Ron, The code did not work, it did not understand this part of the code: AppActivate "Microsoft Excel" If you have any other suggestions that would be great. Thanks again, John -----Original Message----- Try this in Access Sub test() On Error Resume Next Set xl = GetObject(, "Excel.Application") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application") xl.workbooks.Open "C:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
open access from excel ? | Excel Discussion (Misc queries) | |||
EXCEL TRIES TO OPEN IN ACCESS | Excel Discussion (Misc queries) | |||
Access and Excel 2007 don't open | Excel Discussion (Misc queries) | |||
Excel cannot open Access MDB | Excel Discussion (Misc queries) | |||
How can I open an Access adp file from excel? | Excel Discussion (Misc queries) |