LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default is word really smarter than excel?

Jezbel from the word vba newsgroup wrote...........

The difference must lie elsewhere. VBA is exactly the same in both
cases -- literally: it's the same library.


My question remains................

"Bill Kuunders" wrote in message
...
The code below is for an excel routine to find the port number for a
network printer.
The portnumbers are selected at random when logging on to the network.
For us it is normally ne01 ne02 ne03 or ne04


Dim OldPname As String
Dim TempPname As String
OldPname = Application.ActivePrinter
For J = 0 To 99
On Error Resume Next
If J < 10 Then
TempPname = "Adobe PDF on Ne0" & J & ":"
Application.ActivePrinter = TempPname
ElseIf J = 10 Then
TempPname = "Adobe PDF on Ne" & J & ":"
Application.ActivePrinter = TempPname
End If
If Application.ActivePrinter = TempPname Then
Exit For
End If
Next J
Application.ActivePrinter = "TempPname"
ThisWorkbook.Worksheets(1).PrintOut , Copies:=1,ActivePrinter: _
=TempPname, Collate:=True
Application.ActivePrinter = OldPname


The code works perfect.
My question is..............
Why does word not need to go through the loop of allocating numbers until
there is a match?

In word these two lines return the right printer including the right port

TempPname = "Adobe PDF "
Application.ActivePrinter = TempPname

Do I really have to admit that word is smarter than excel?


Regards
Bill Kuunders



 
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
Need Excel count of 1 word if found in multi-word cells of column Function_Challenged Excel Worksheet Functions 1 August 27th 09 12:08 AM
Smarter way out will be to follow the market tips... supertrader07 New Users to Excel 1 August 3rd 07 04:38 AM
Copy from Word to Excel, and retain indent, plus word wrap Eric Excel Discussion (Misc queries) 1 March 9th 07 03:15 AM
Smarter Idea Lp12 Excel Worksheet Functions 4 March 6th 07 11:38 AM
Print labels by using Excel data in a Word mail into word Zoey Excel Discussion (Misc queries) 1 November 1st 05 09:08 PM


All times are GMT +1. The time now is 11:45 PM.

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"