Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
open access from excel ? יריב החביב Excel Discussion (Misc queries) 2 July 21st 08 01:49 PM
EXCEL TRIES TO OPEN IN ACCESS cfarns Excel Discussion (Misc queries) 2 September 20th 07 01:50 AM
Access and Excel 2007 don't open PNH@CLC Excel Discussion (Misc queries) 1 August 17th 07 05:21 AM
Excel cannot open Access MDB Neva Excel Discussion (Misc queries) 0 April 4th 05 08:35 PM
How can I open an Access adp file from excel? revelatgc Excel Discussion (Misc queries) 0 February 25th 05 04:37 PM


All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"