(Leo) Strange print to file behaviour
I have a payroll in an Excell file, in which each sheet belongs to an
employee. Since I have a lot functions or calculation in that file I can not
use copy/paste ,and instead I use File - print ... command to print each
sheet seperately to a "tiff" file, then I mail them for the coresponding
employee. well it takes time.. so I decided to write codes to do it
automatically; such as ;
Dim EmpSign, Filename As String, i As Integer
For i = 4 To 35
EmpSign = Worksheets("PAYROLL").Cells(i, 5).Value
Filename = "H:/Accounting/Employees/SalarySlips/" & EmpSign & ".tiff"
Worksheets(EmpSign).PrintOut PrintToFile:=True, PrToFileName:=Filename
but I found that the results were quite strange and different under
1) when I have used previously manual job, by file,print... the code above
afterward the codes work correctly, with only this problem that it opens all
30 tiff files...have to close them.
2) but when i restart the computer and run the code (without trying to do it
manually on that session), it makes all 30 tiff files, but I can not open
them and it prompts me each with;
" The selected file is not a valid Microsoft Office Document Imaging file"
why is it so?? please help!
Thans & Best regards
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1