Queenofmycastle
Board Regular
- Joined
- Oct 27, 2009
- Messages
- 62
- Office Version
- 2016
- Platform
- Windows
I have a file that I use annually to print lots of forms for 20 "Locations". They pull information to include things such as Location Name, Address, etc..
Our company just upgraded from 2007 20 Professional 2021 and today was the first time I attempted to run any macros.
This is the first one:
Sub PrintEntireSetJ6()
Dim i As Integer
' First choose a printer
Application.Dialogs(xlDialogPrinterSetup).Show
[J6].FormulaR1C1 = "0"
ExecuteExcel4Macro _
"PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
For i = 1 To 20
[J6].FormulaR1C1 = CStr(i)
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
Next i
[J6].FormulaR1C1 = "1"
End Sub
This time I am getting a Compile Error "Can't find project or Library" The first line highlights as yellow and the [J6] highlights as blue. Our IT person stated it was probably due to the file name extension being different but I don't know how to fix my problem. Any advice appreciated!
Our company just upgraded from 2007 20 Professional 2021 and today was the first time I attempted to run any macros.
This is the first one:
Sub PrintEntireSetJ6()
Dim i As Integer
' First choose a printer
Application.Dialogs(xlDialogPrinterSetup).Show
[J6].FormulaR1C1 = "0"
ExecuteExcel4Macro _
"PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
For i = 1 To 20
[J6].FormulaR1C1 = CStr(i)
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
Next i
[J6].FormulaR1C1 = "1"
End Sub
This time I am getting a Compile Error "Can't find project or Library" The first line highlights as yellow and the [J6] highlights as blue. Our IT person stated it was probably due to the file name extension being different but I don't know how to fix my problem. Any advice appreciated!