Open exisiting excel file

torquay

Registered User.
Local time
Today, 19:31
Joined
Dec 27, 2005
Messages
85
Hi can anyone point me in the right direction.
I have imported an "Act" database to access, all has gone somewhat well. I am stuck on a problem with linking to existing excel files.
I have an file attachment table called Fileattachments with the following fields

ContactID
CreatedOn
ExcelFile

The "Excelfile" field contains a reference to an existing excel file on the hard drive that "Act" created i.e. "Invoice Basic1076.xls". I would like the user to click on the form field "Excelfile" and for the corresponding excel file to open.
There are currently 6K files that need to be linked.
Thank you for your time.
 
If you have the folder location you can use something like:

Dim strPath As String

strPath = "C:\YourBasePathHere\" & Me!ExcelFile

FollowHyperlink strPath
 
Thank you very much for the speedy reply.

Not sure what has gone wrong but I am getting VB errors come up. The form does open but with errors
The errors are under Trans_Functions and the error is

Compile error: Can't find project or libary.

The errors come up as follows

Public Sub Trans_Window_Deactivated(ByVal Wn As Window)
Call Window_Deactivated(Wn)
End Sub

Public Sub Trans_WorkBook_DeActivated()
Call Workbook_DeActivated
End Sub

Public Sub Trans_Workbook_IsActivated()
Call Workbook_IsActivated
End Sub

Public Sub Trans_Window_Activated(ByVal Wn As Window)
Call Window_Activated(Wn)
End Sub


The code I used was


Private Sub ExcelFile_Click()
Dim strPath As String

strPath = "C:\Documents and Settings\torquay\My Documents\" & Me!ExcelFile

FollowHyperlink strPath
End Sub

Thanks again for your time
 
What line does it highlight when you get the error?
 
Simple Software Solutions

In the attached zip is a simple demo of loading files from a known folder and the facility to double click on the file and it opens automatically in the appropriate software.

CodeMaster::cool:
 

Attachments

The lines that are highlighted are as follows (all with ++++)

Public Sub Trans_Window_Deactivated(ByVal Wn As Window)
++++++Call Window_Deactivated(Wn)++++++
End Sub

Public Sub Trans_WorkBook_DeActivated()
++++++Call Workbook_DeActivated++++++++++
End Sub

Public Sub Trans_Workbook_IsActivated()
+++++++Call Workbook_IsActivated++++++
End Sub

Public Sub Trans_Window_Activated(ByVal Wn As Window)
++++++Call Window_Activated(Wn)++++++
End Sub

Thanks
 

Users who are viewing this thread

Back
Top Bottom