Error 438 Launching Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to open an Excel workbook from Access and I get error 438
when I try to do this. Below is my code:

Dim appExcel As Excel.Application
Dim WBook As Excel.Workbook
Set appExcel = New Excel.Application
' Set WBook = GetObject("C:\test\form.xlt")

What am I missing?
 
Instead you can try using FollowHyperlink

dim strExcelToOpen as string

strExcelToOpen = "C:\test\form.xlt"
application.FollowHyperlink strExcelToOpen
=====================================
About the error, do you have reference to Microsoft Excel object?
 
Yes I have the Excel Reference checked.

I just found that the .xlt file was stored in a different location than
where I thought it was stored--so I moved it.

The excel file now opens but fails on the file save: (any ideas?)

Dim appExcel As Excel.Application
Dim WBook As Object

Set appExcel = CreateObject("Excel.Application")
Set WBook = appExcel.Workbooks.Open("c:\test\form.xlt")

Process variables..... (this works)

.ActiveWorkbook.SaveAs filename:="C:\test\newbook.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
.Visible = True
.Activate

Thanks for your replies!!
 
Back
Top