Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Forcing A Line To Execute Prior To Continuing

Hi Folkes,
Sorry if this a duplicate.
I am going mad with this one. I have lost all those marbles that
everybody reckons I hadn't got in the first place!
The main purpose of my script is to activate a print property, print
and then deactivate the print property (in an external program).Code
attached below.


The following code activates print properties of an external
application. It is not excel. Both lines work seperately but put them
together and it just sets the property the last one it comes across.


My thinking was it runs the macro quicker then it can execute so I
thought putting a wait inbetween the 2 lines would solve my problem but
it doesn't. The wait works but the 2 line of code don't execute. I've
tried putting the 2nd line of code in a seperate macro that is called
but still not effect.
Can anybody point me in the right direction please of what I may try
next ?
Pleading, to put me out of my misery!
Donna


Sub Main()
Dim App As Object
Set App = CreateObject("PCDLRN.Applicati*on")
Dim Part As Object
Set Part = App.ActivePartProgram
Dim DmisCommands As Object
Set DmisCommands = Part.Commands


Part.EditWindow.ReportMode
Part.EditWindow.SetPrintOption*s PCD_PRINTER,PCD_ON,PCD_AUTO,1 ' Prints
OofTols
Call Wait (10)
Part.EditWindow.SetPrintOption*s PCD_OFF,PCD_OFF,PCD_APPEND,1 ' Resets
To No Printer


End Sub


Sub Wait (Seconds As Variant)
Ts =Timer
Te = Timer
Elapsed = Te-Ts
While Elapsed < Seconds
Te = Timer
Elapsed = Te-Ts
Wend
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Forcing A Line To Execute Prior To Continuing

This is not a solution; I just have some comments:

1. It is somewhat difficult to read your message: you might have added line
numbers to the code to make references explicit.
2. Is ReportMode within "Part.EditWindow.ReportMode" a method? If it is a
property its result needs to be assigned.
3. Try DoEvents instead of Wait.
4. I assume that the constants, like PCD_PRINTER, are defined somewhere?
5. Which 2 lines of code? There is only one line after Wait.

"Donna" wrote:

Hi Folkes,
Sorry if this a duplicate.
I am going mad with this one. I have lost all those marbles that
everybody reckons I hadn't got in the first place!
The main purpose of my script is to activate a print property, print
and then deactivate the print property (in an external program).Code
attached below.


The following code activates print properties of an external
application. It is not excel. Both lines work seperately but put them
together and it just sets the property the last one it comes across.


My thinking was it runs the macro quicker then it can execute so I
thought putting a wait inbetween the 2 lines would solve my problem but
it doesn't. The wait works but the 2 line of code don't execute. I've
tried putting the 2nd line of code in a seperate macro that is called
but still not effect.
Can anybody point me in the right direction please of what I may try
next ?
Pleading, to put me out of my misery!
Donna


Sub Main()
Dim App As Object
Set App = CreateObject("PCDLRN.ApplicatiĀ*on")
Dim Part As Object
Set Part = App.ActivePartProgram
Dim DmisCommands As Object
Set DmisCommands = Part.Commands


Part.EditWindow.ReportMode
Part.EditWindow.SetPrintOptionĀ*s PCD_PRINTER,PCD_ON,PCD_AUTO,1 ' Prints
OofTols
Call Wait (10)
Part.EditWindow.SetPrintOptionĀ*s PCD_OFF,PCD_OFF,PCD_APPEND,1 ' Resets
To No Printer


End Sub


Sub Wait (Seconds As Variant)
Ts =Timer
Te = Timer
Elapsed = Te-Ts
While Elapsed < Seconds
Te = Timer
Elapsed = Te-Ts
Wend
End Sub

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
Forcing a line feed in the middle of a string dhstein Excel Discussion (Misc queries) 3 July 19th 09 10:57 PM
Forcing the cursor to move to A of the next line after D of the pr Kitti Excel Discussion (Misc queries) 4 June 16th 07 04:42 PM
Forcing A Line To Execute Prior To Continuing [email protected] Excel Programming 0 March 10th 05 02:04 PM
Forcing text onto new line in cell Doug Poll New Users to Excel 2 December 3rd 04 12:09 PM
continuing code on another line? neowok[_49_] Excel Programming 9 April 16th 04 11:46 AM


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