Access Open Excel to a Specific Sheet and Row (1 Viewer)

mcclunyboy

Registered User.
Local time
Today, 04:11
Joined
Sep 8, 2009
Messages
292
Hi,

Can anyone advise how to open MS Excel from a MS Access database (plenty online really) but then select a worksheet and a row in the excel sheet (can't find anything)?

I also need to open MS Access from the Excel worksheet and I was hoping to use
Code:
Set oApp = CreateObject("Access.Application")
however it seems Access 2010 does not support this :(

Any help without redeveloping both into a single MS Access application would be appreciated.

Thanks,
 

mcclunyboy

Registered User.
Local time
Today, 04:11
Joined
Sep 8, 2009
Messages
292
immediate follow up - I got my VB working to open access to a specific form/record in access almost. There is one problems:

-> I "think" the following code is pretty close, it is opening access without any errors but MS Access closes before it seems to open - what am I doing wrong, I am using Office 2010

Code:
Sub Button2_Click()

   Dim oApp As Object
   Dim DBPath As String
   Dim LTitle As String
   
   'Path to Access database
   DBPath = "dbpath.accdb"
   
   'Open Access and make visible
   Set oApp = CreateObject("Access.Application")
   'Open Access database as defined by DBPath variable
   oApp.OpenCurrentDatabase DBPath
   oApp.Visible = True
   
   'Open form called form db filtering by title
   LTitle = ActiveCell.Cells
   oApp.DoCmd.OpenForm "Form DB",acNormal , , "Title = '" & LTitle & "'"

End Sub
If I add a simple msgBox "LTitle:" & Ltitle, it returns what I expect and the database doesn't close. the oApp.DoCmd.... seems to cause the problem?

Is office 2010 the problem, is there a new way of doing things?
 
Last edited:

Users who are viewing this thread

Top Bottom