Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default how automaticly print excel sheet.

How can I automaticly print a spreadsheet from another software calling
excel.

ie: in Dbase, If I type run(.t., "excel.exe"), it will load excel, but what
I would like to do is load the file and print it without human intervention.

would be something like this:
excel.exe/open"myfile.xls"/print it.
- it would launch excel, open myfile.xls, then print it. Hoping it will also
close automaticly.

I really hope you can help me with this one.

Thanking you in advance.

Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default how automaticly print excel sheet.

One way to do that is to use the Windows ShellExecute API call. This
essentially does the same thing as right-clicking an XLS file in Windows
Explorer and picking Print. I don't know what the dBase syntax is for
making API calls (or if it's supported at all) but this is how it could be
done from another app that supports VB like Word:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub LaunchXLS()
ShellExecute 0, "Print", "c:\book1.xls", "", "C:\", 0
End Sub


--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default how automaticly print excel sheet.

Do you have an example of a working one? even VB will do.

Thanks


"Jim Rech" wrote in message
...
One way to do that is to use the Windows ShellExecute API call. This
essentially does the same thing as right-clicking an XLS file in Windows
Explorer and picking Print. I don't know what the dBase syntax is for
making API calls (or if it's supported at all) but this is how it could be
done from another app that supports VB like Word:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub LaunchXLS()
ShellExecute 0, "Print", "c:\book1.xls", "", "C:\", 0
End Sub


--
Jim Rech
Excel MVP




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default how automaticly print excel sheet.

I made it work with DBase+

Thank you very much !!!!!!
Very appreciated !

Paul.

"Jim Rech" wrote in message
...
One way to do that is to use the Windows ShellExecute API call. This
essentially does the same thing as right-clicking an XLS file in Windows
Explorer and picking Print. I don't know what the dBase syntax is for
making API calls (or if it's supported at all) but this is how it could be
done from another app that supports VB like Word:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub LaunchXLS()
ShellExecute 0, "Print", "c:\book1.xls", "", "C:\", 0
End Sub


--
Jim Rech
Excel MVP




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
Footes - Automaticly print on every print job - Excel 2007 JohnH Excel Discussion (Misc queries) 1 August 21st 09 01:32 PM
Can Excel automaticly help me Kim New Users to Excel 2 October 17th 07 03:10 PM
automaticly paste info from another sheet anchor's aweigh Excel Discussion (Misc queries) 1 August 26th 07 07:18 AM
Why do I get a print error light trying to print an excel sheet ? SMC Excel Discussion (Misc queries) 2 November 5th 05 01:36 AM
How do I copy a print format from sheet to sheet in excel ? kernat Excel Discussion (Misc queries) 1 July 22nd 05 04:59 PM


All times are GMT +1. The time now is 05:42 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"