Opening Excel template

jenvandiver

Registered User.
Local time
Today, 16:22
Joined
Oct 16, 2002
Messages
56
Hi, any help on this is appreciated.

I'm trying to open an Excel template from a form in access. If I hyperlink the template from a button, it goes directly to the original template without opening a document based on the template, which is the whole purpose! I've tried to code the language to open it, but I'm having all sort of trouble. I'm using Access 2000, I've found the properties to use for Microsoft Word, but there's no easy way to open Excel. Can anyone help?
 
Could you post the code you have tried as well as maybe clarifying the template and the document situation.

Is there one specific document you always want opened? Or are there many different ones all based on the same template?

Are you hyperlinking to the document or just the template?

More info would be great.

Pookatech
 
Thanks for your help.

I have an Excel template that runs an automatic query on an Access table when opened, then reformats the information on another sheet in the workbook. From Access, I'm trying to code a button on a form that will automatically open this template. When you double click on a template, usually it opens as a new document with all the features of the template, but it can be saved as a new document. So I want the user to be able to access the data from Access by opening the Excel template, then saving that document for the system they're working on.

When I've tried to hyperlink straight to the template from a control in Access, it opens the actual template itself and when you try to save it, it actually saves the changes to the template. I don't want the user to be able to do this.

I've successfully opened Microsoft Word templates from an Access form button using the following code:

Private Sub CreateSTRAP_Click()
Dim lngRetval As Long
Dim strCurDir As String

lngRetval = MsgBox("Please wait..." & vbCrLf & "", vbOKOnly + vbInformation + vbDefaultButton1, "Creating STRAP")
Select Case lngRetval
Case vbOK
End Select

StartWord True

strCurDir = GetCurrentPath
OpenDocument (strCurDir & "Templates\STRAP Demo.dot")

With m_appWord
.Application.ScreenUpdating = False
.ActiveDocument.ShowSpellingErrors = False
.Visible = False
.ActiveDocument.Bookmarks("SystemName").Range = Me.SystemName
.ActiveDocument.Bookmarks("Acronym").Range = Me.Acronym
.ActiveDocument.Bookmarks("SystemDescription").Range = Me.SystemDescription
.ActiveDocument.Bookmarks("Date").Range = Me.Date
.ActiveDocument.Bookmarks("Version").Range = Me.Version
.ActiveDocument.Fields.Update
.Application.ScreenUpdating = True
.Visible = True
End With

End Sub

I need to know how to change the Word part to Excel.

Thanks again,
 

Users who are viewing this thread

Back
Top Bottom