Using Access to Open other Applications

  • Thread starter Thread starter Roger Converse
  • Start date Start date
R

Roger Converse

Hello,

I have a DB that creates a report and outputs that reprot as an rtf file.
What I would like my app to be able to do is open that report, copy what is
in there and then close the report.

Here is what I have so far:

Set OpenPORPTObject = GetObject("F:\OpenAccess\Daily Open
PO\Open_PO_Summary.rtf")

Where would I find a list of methods for this? In help it shows
MyObject.InsertText and MyObject.SaveAs, so I am guessing there is something
out there that can do what I am trying to accomplish.

Similarly, would it be possible to have an Excel file opened and have it run
a macro? I know how to open an Excel file through Access, but wouldn't know
how to have it run the macro.

Thanks,
Roger
 
Use FollowHyperlink to open a file, the right program will be opened
according to the extention of that file (as specified in widows system)

Dim FileNameAndLocation As String
FileNameAndLocation = "F:\OpenAccess\Daily Open PO\Open_PO_Summary.rtf"
Application.FollowHyperlink FileNameAndLocation
 
Thanks.

I am good with getting the Excel file open. I am looking for a way to
trigger a query to run in that file.

I have something like this that I got from someone else, but I am having
issues still.

Private Sub Command3_Click()
Dim objXL As Object, x
On Error Resume Next
Set objXL = CreateObject("Excel.Application")
With objXL.Application
.Visible = True
'Open the Workbook
.Workbooks.Open "C:\testlog.XLS"
.ActiveWorkbook.RunAutoMacros xlAutoOpen
x = .Run("log2sms", 0)
End With
Set objXL = Nothing

Thank you,
Roger
 
"having issues still" doesn't really give us much to go on.

What's the problem?
 
Back
Top