#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Open Files

Hello,
I have a ton of files that need to be opened and printed. I have a list of
their names in an excel spread sheet and I am wondering if it is possible to
write a program that would open up each of those files and/or print them off.
All the files are tif files.

I have tried:
Open "C:\Documents and Settings\JSena\My Documents\ECOacksheet1" For Input
Access Read Lock Read As #1 'if I run this twice it gives me an error
because the file is already opened, but I can not see it as opened.

also tried:

fileToOpen = Application _
.GetOpenFilename()
If fileToOpen < False Then
MsgBox "Open " & fileToOpen
End If 'but obviously this does not actually open the file, and don't know
how to make it.

also tried:
Application.FindFile 'and this seems like it would work if only I could
enter aruguments so that it could find the files on its own as long as I gave
it the paths.

Thank you very much for any help with this,
Jordan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Open Files

Jordan,

Set a print area that is large enough to hold your largest tif file, and use
page setup to set the print to fit to 1 page. The specific code of how to
open the file depends on how your file names are stored: if the have the
..tif at the end, then you can delete the & ".tif" part of the code. If they
have the drive and folder path in the cell, then you can delete the
C:\Foldername part. (It would have been helpful if you posted an
example...).

Anyway, after you set up the page, run a macro like this:

Sub JordanTifPrint()
Range("B1").Select ' this is the top left cell of your print range

For Each myCell In Range("A1:A100") ' this is your list
ActiveSheet.Pictures.Insert("C:\FolderName" _
& myCell.Value & ".tif").Select
ActiveSheet.PrintOut
Selection.Delete
Next myCell
End Sub

HTH,
Bernie
MS Excel MVP

"Jordan" wrote in message
...
Hello,
I have a ton of files that need to be opened and printed. I have a list

of
their names in an excel spread sheet and I am wondering if it is possible

to
write a program that would open up each of those files and/or print them

off.
All the files are tif files.

I have tried:
Open "C:\Documents and Settings\JSena\My Documents\ECOacksheet1" For Input
Access Read Lock Read As #1 'if I run this twice it gives me an

error
because the file is already opened, but I can not see it as opened.

also tried:

fileToOpen = Application _
.GetOpenFilename()
If fileToOpen < False Then
MsgBox "Open " & fileToOpen
End If 'but obviously this does not actually open the file, and don't

know
how to make it.

also tried:
Application.FindFile 'and this seems like it would work if only I

could
enter aruguments so that it could find the files on its own as long as I

gave
it the paths.

Thank you very much for any help with this,
Jordan




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
emailing files from excel, the files will not go until I open up . joe New Users to Excel 2 September 18th 09 02:12 PM
how do I toggle between 2 open excel files and leave both open Big D in Brighton Excel Discussion (Misc queries) 1 November 6th 08 04:28 PM
How to change default Open/Files of Type to "Microsoft Excel Files Tammy Excel Discussion (Misc queries) 2 January 14th 08 11:06 PM
Can not open excel files without open application Taarfa Excel Discussion (Misc queries) 3 July 9th 05 11:56 PM
file open via IE hyperlink causes already open files to shrink and tile Marc Setting up and Configuration of Excel 0 May 4th 05 08:13 PM


All times are GMT +1. The time now is 10:19 AM.

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

About Us

"It's about Microsoft Excel"