M
muziq2
Hi,
I have the following code in an excel workbook that works fine on m
box running Excel 2000. When I try to open this on a machine runnin
Excel '97 I'm getting a debug error. The Private Sub Workbook_Ope
line is highlighted as well as the Set wb = is highlighted.
Will this code work in Excel '97 or is there some other problem (i.e
access to the other workbook) that I haven't considered. Although th
users that are having the problems should have access to this file.
Thanks in advance.
Jeff
Private Sub Workbook_Open()
Dim Workbook As Workbook
Application.ScreenUpdating = False ' turn off the screen updating
Set wb
Workbooks.Open("\\sfna-fs4\hrs\shared\hr_(all)\accidentflashreport\userformtest.xls"
True, True)
' open the source workbook, read only
With ThisWorkbook.Worksheets("Training")
' read data from the source workbook
.Range("A1:B13").Formula
wb.Worksheets("Sheet3").Range("A1:B13").Formula
End With
With ThisWorkbook.Worksheets("SignUp")
' read data from the source workbook
.Range("A:B").Formula
wb.Worksheets("SignUp").Range("A:B").Formula
End With
wb.Close False ' close the source workbook without saving an
changes
Set wb = Nothing ' free memory
Application.ScreenUpdating = True ' turn on the screen updating
End Su
I have the following code in an excel workbook that works fine on m
box running Excel 2000. When I try to open this on a machine runnin
Excel '97 I'm getting a debug error. The Private Sub Workbook_Ope
line is highlighted as well as the Set wb = is highlighted.
Will this code work in Excel '97 or is there some other problem (i.e
access to the other workbook) that I haven't considered. Although th
users that are having the problems should have access to this file.
Thanks in advance.
Jeff
Private Sub Workbook_Open()
Dim Workbook As Workbook
Application.ScreenUpdating = False ' turn off the screen updating
Set wb
Workbooks.Open("\\sfna-fs4\hrs\shared\hr_(all)\accidentflashreport\userformtest.xls"
True, True)
' open the source workbook, read only
With ThisWorkbook.Worksheets("Training")
' read data from the source workbook
.Range("A1:B13").Formula
wb.Worksheets("Sheet3").Range("A1:B13").Formula
End With
With ThisWorkbook.Worksheets("SignUp")
' read data from the source workbook
.Range("A:B").Formula
wb.Worksheets("SignUp").Range("A:B").Formula
End With
wb.Close False ' close the source workbook without saving an
changes
Set wb = Nothing ' free memory
Application.ScreenUpdating = True ' turn on the screen updating
End Su