#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default save file

Hi,
I've got a problem in my code I've written below.
The loop works for the first, third and fourth graphic: that is,
it saves them. But it doesn't save the second graph.
I've put a "pause" at the start and at the end of the loop, but
I haven't solved the problem..

Any suggestion very appreciated!

'-----------------------------------------------------

Private Sub CommandButton1_Click()

Dim i As Integer

Dim a As Range
Dim b As Integer
Set a = Range("C10:C13")

Dim PauseTime, Start, Finish, TotalTime

b = a.Rows.Count

For i = 1 To b

PauseTime = 3
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start

BLP = DDEInitiate("winblp", "bbk")
Call DDEExecute(BLP, "<blp-1<cancel" & a(i).Text &
"<IndexGPC<GO")

PauseTime = 3
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start

Call DDEExecute(BLP, "<SAVE<GO")
Call DDETerminate(BLP)

Next i

End Sub

'------------------------------------------------------------------------

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default save file

graphs can be on a Worksheet or on a chart sheet: is the second graph where
the others aren't?

"asburypark98" wrote:

Hi,
I've got a problem in my code I've written below.
The loop works for the first, third and fourth graphic: that is,
it saves them. But it doesn't save the second graph.
I've put a "pause" at the start and at the end of the loop, but
I haven't solved the problem..

Any suggestion very appreciated!

'-----------------------------------------------------

Private Sub CommandButton1_Click()

Dim i As Integer

Dim a As Range
Dim b As Integer
Set a = Range("C10:C13")

Dim PauseTime, Start, Finish, TotalTime

b = a.Rows.Count

For i = 1 To b

PauseTime = 3
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start

BLP = DDEInitiate("winblp", "bbk")
Call DDEExecute(BLP, "<blp-1<cancel" & a(i).Text &
"<IndexGPC<GO")

PauseTime = 3
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start

Call DDEExecute(BLP, "<SAVE<GO")
Call DDETerminate(BLP)

Next i

End Sub

'------------------------------------------------------------------------


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default save file

Graphs are called on a provider by DDE command and then saved in a
directory (it doesn't appear in this part of the code, because it is
holded in another sub routine), but the directory is the same for all
the graphs.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default save file

How is the value for a(2).Text different from the other 3. Is it correct?
Does it contain spaces?

--
Regards,
Tom Ogilvy


"asburypark98" wrote:

Graphs are called on a provider by DDE command and then saved in a
directory (it doesn't appear in this part of the code, because it is
holded in another sub routine), but the directory is the same for all
the graphs.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default save file

Hi Tom,

How is the value for a(2).Text different from the other 3. Is it correct?
Does it contain spaces?



a(2) contains a text as a(1):
a(1).text = SP
a(2).text = TPX
so the format is the same.. no spaces...

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
when i save xls file, debug script is running and canno't save fil Imtiaz Excel Discussion (Misc queries) 1 July 16th 05 03:47 PM
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


All times are GMT +1. The time now is 05:33 PM.

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"