I need to load a Form that was created in Excel, in Word. The form contains code specific to excels object model. I can open the file ok using:
Sub test()
Dim Spreadsheet As Object
Set Spreadsheet = GetObject("C:\Spreadsheet.xls"
With Spreadsheet
.Application.Visible = True
.Parent.Windows("Spreadsheet.xls"
.Visible = True
.Application.Workbooks("Spreadsheet.xls"
.Saved = True
.Application.Quit
End With
Set Spreadsheet = Nothing
End Sub
but in the middle of the 'With' statement, i'd like to load a form stored in the xls. I get an error message saying (Object Required). Is this the best way to go about it or should i do it a diffrent way??
Regards
Mike Hold the wheel and Drive
Sub test()
Dim Spreadsheet As Object
Set Spreadsheet = GetObject("C:\Spreadsheet.xls"
With Spreadsheet
.Application.Visible = True
.Parent.Windows("Spreadsheet.xls"
.Application.Workbooks("Spreadsheet.xls"
.Application.Quit
End With
Set Spreadsheet = Nothing
End Sub
but in the middle of the 'With' statement, i'd like to load a form stored in the xls. I get an error message saying (Object Required). Is this the best way to go about it or should i do it a diffrent way??
Regards
Mike Hold the wheel and Drive