Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Printing an error report



I'd like to print a simple error report from the application to the default network printer without using a worksheet. The text is in a string.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing an error report

First, I went to the immediate window in the VBE to query the activeprinter
string

To a Network printer
? activePrinter
\\ARDAPS01\1D343E on Ne02:

then I used the first part in the below code:

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "\\ARDAPS01\1D343E" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub

Worked for me.

Regards,
Tom Ogilvy


"Steve" wrote in message
...


I'd like to print a simple error report from the application to the

default network printer without using a worksheet. The text is in a string.

Any ideas?



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
printing a report Art Excel Worksheet Functions 0 March 2nd 10 02:12 AM
Printing multiple report based on a list pasket_YM Excel Discussion (Misc queries) 1 February 20th 10 10:47 AM
Printing multiple graphs on a report Jon M Charts and Charting in Excel 0 September 8th 09 02:49 AM
Printing a report sambles33 Excel Discussion (Misc queries) 0 March 26th 08 02:51 PM
Printing report that is portrait and landscape jag53 Excel Discussion (Misc queries) 1 February 2nd 08 04:11 AM


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