I am looking for the VBA code that will let me open an excel workbook and run a macro in it then close the workbook.
I am transfering in data from excel, but it needs manipulation first.
Using Access 2007 and Excel 2007.
This basic code right here continues to get hung up on the GetObject
Thx
I am transfering in data from excel, but it needs manipulation first.
Using Access 2007 and Excel 2007.
Code:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim xlsApp As Excel.Application
Dim xlswkb As Excel.Workbook
Dim f As Object
Dim myfile As String
Set xlsApp = CreateObject("Excel.Application")
Set f = Nothing
myfile = ""
Set f = Application.FileDialog(3)
f.Title = "SELECT PBUS DATA FILE TO IMPORT"
f.AllowMultiSelect = False
f.Show
With f
myfile = .SelectedItems(1)
End With
Set xlswkb = GetObject([myfile])
Thx
Last edited by a moderator: