Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
leo leo is offline
external usenet poster
 
Posts: 74
Default (Leo) Strange print to file behaviour

Hi, there,
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 ;
'======
Sub MakeSlips()
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
Next i

End Sub
'======
but I found that the results were quite strange and different under
different situations.
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
Leo, InfoSeeker
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange if(***) behaviour? Excel 2003 - SPB Excel Discussion (Misc queries) 6 August 6th 06 05:34 PM
Very strange add-in file behaviour RB Smissaert Excel Programming 12 February 14th 05 05:13 PM
Strange behaviour Edgar Thoemmes Excel Worksheet Functions 1 February 8th 05 03:20 PM
Strange behaviour in VBA Help Michael Singmin Excel Programming 4 June 4th 04 07:06 PM
strange behaviour Patrick Molloy Excel Programming 0 September 4th 03 07:51 AM


All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"