Based on code from a board advisor I am trying to run the below macros.
But My system freezes when it gets to
workbooks.Open filename:=savename
not recognizing the name. Can anyone explain what I did wrong??
Here is the complete module.
Option Compare Database
Option Explicit
Sub spine()
Dim excelsheet As Object
Dim savename As String
Call XLLibrary
savename = InputBox("Path and File Name", "C:\filename")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "qtable1", savename, True
workbooks.Open filename:=savename
Set excelsheet = workbooks.Application.activeworkbook
With excelsheet
.Application.Visible = True
sheets(1).range(cells(1, 1), cells(2, 8)).font.bold = True
.Save
.Quit
End With
End Sub
Sub XLLibrary()
On Error Resume Next
Application.References.AddFromGuid "{00020813-0000-0000-c000-000000000046}", 2, 3
End Sub
End Sub
But My system freezes when it gets to
workbooks.Open filename:=savename
not recognizing the name. Can anyone explain what I did wrong??
Here is the complete module.
Option Compare Database
Option Explicit
Sub spine()
Dim excelsheet As Object
Dim savename As String
Call XLLibrary
savename = InputBox("Path and File Name", "C:\filename")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "qtable1", savename, True
workbooks.Open filename:=savename
Set excelsheet = workbooks.Application.activeworkbook
With excelsheet
.Application.Visible = True
sheets(1).range(cells(1, 1), cells(2, 8)).font.bold = True
.Save
.Quit
End With
End Sub
Sub XLLibrary()
On Error Resume Next
Application.References.AddFromGuid "{00020813-0000-0000-c000-000000000046}", 2, 3
End Sub
End Sub