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: 29
Default [VBA] loop, problem of 101'st iteration

hello,

i wrote such a code:

Sub All_creation()
Application.ScreenUpdating = False
Dim VBCodeMod As CodeModule
Dim StartLine As Long
Dim HowManyLines As Long
Dim PPObj As Object

Set PPObj = CreateObject("PowerPoint.application")

Sheets("ID").Cells(43, 11).Value = 3

a = Range("M50").Value

For i = 1 To a 'a = 140 (LICZBA ITERACJI)

Sheets("ID").Cells(50, 11).Value = i

Range("L50").Formula = "=LEFT(INDEX(etykiety!R4C7:R300C7,RC[-1],1),5)"
Range("M50").Formula =
"=ROWS(etykiety!R4C7:R300C7)-COUNTBLANK(etykiety!R4C7:R300C7)"
Range("N50").Formula =
"=IF(R50C12="""","""",INDEX(R3C2:R602C2,MATCH(MID( LEFT(R50C12,4)&""0"",1,5),R3C6:R602C6,0),1))"
Range("O50").Value = "0"
Range("P50").Formula = "=IF(R50C12="""","""",MID(R50C12,5,1))"

Sheets("ID").Cells(3, 8).Value = Sheets("ID").Cells(50, 15).Value
'dopelnienie
Sheets("ID").Cells(3, 13).Value = Sheets("ID").Cells(50, 14).Value 'main
Sheets("ID").Cells(3, 14).Value = Sheets("ID").Cells(50, 16).Value 'klasa

Calculate

'### PRN ###

With PPObj
' .presentations.Add
.presentations.Open Filename:="F:\Analizy ISI\pl\AnBrMan.ppt"
.Visible = True
.Run "AnBrMan.ppt!UpdateMode"
.presentations("AnBrMan.ppt").Save

With PPObj.ActivePresentation.PrintOptions
.PrintInBackground = msoTrue
.RangeType = ppPrintAll
.Collate = msoTrue
.PrintColorType = ppPrintColor
.ActivePrinter = "Adobe PDF"
End With

PPObj.ActivePresentation.PrintOut PrintToFile:="F:\Analizy
ISI\pl\files\F-pdf\K\" & _
Workbooks("panel_et.xls").Sheets("ID").Cells(3, 16).Value & "\" & _
Workbooks("panel_et.xls").Sheets("ID").Cells(3, 15).Value & ".prn"

.presentations("AnBrMan.ppt").Close

End With

Next i

Application.ScreenUpdating = True
End Sub


key parameter in module is 'a' (it is number of iteration in loop)
unfortunately when 'i' equals 101 a module stops with error (error concerns
module in powerpoint document):

..Run "AnBrMan.ppt!UpdateMode"

best regards

 
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
Frustrating Boolean/loop iteration problem carg1[_16_] Excel Programming 2 May 11th 06 10:21 PM
Frustrating Boolean/loop iteration problem carg1[_15_] Excel Programming 2 May 5th 06 11:10 PM
Advancing to the next iteration of a loop? Maury Markowitz Excel Programming 4 April 2nd 05 05:39 PM
Iteration loop Brad[_20_] Excel Programming 2 May 28th 04 03:11 PM
Iteration loop Brad[_20_] Excel Programming 0 May 28th 04 01:31 PM


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