Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Slow Macro...Takes at least 1 Hour to Run

Hello All,

I need some help with my macro. My macro currently takes about an hour
to run, most of the time it doesn't finish. I can't seem to understand
why it is so ridiculously slow.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Slow Macro...Takes at least 1 Hour to Run

post the code.

--


Gary


wrote in message
...
Hello All,

I need some help with my macro. My macro currently takes about an hour
to run, most of the time it doesn't finish. I can't seem to understand
why it is so ridiculously slow.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Slow Macro...Takes at least 1 Hour to Run

On Jan 15, 11:15*pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
post the code.

--

Gary



Gary,


Sorry, I didn't mean to sound rude. I was in the process of posting my
next message when you responded and didn't see your response until I
finished.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Slow Macro...Takes at least 1 Hour to Run

Okay, I didn't get to finish.....(I'm really new to this, so please
help),

I'm trying to pull a lot of different graphs and data from 8 different
excel files and paste them into word. This process is crawling and I
know it should take seconds to do. Can anyone tell me why it is so?

Here is a small portion of what I have created:


myspreadsheet.worksheets("sheet1").chartobject(1). chart.chartarea.copy
Selection.GoTo what:=wdGoToBookmark, name:="bookmarkname"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnahncedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

myspreadsheet.worksheets("Sheet").range("rangename ").copy
Selection.GoTo What:=wdGoToBookmark, Name:="NameofBookMark"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

1) The first command is just for 1 graph and is repeated for 50 other
graphs. The second is for data tables. The excel files that the macro
is extracting the Graphs and Data from are large, could this be a
reason why the macro is running so slow?

2) Sometimes I run into an error: "Disk is Full" and other times it is
not. I've increased my virtual memory and I think I have sufficient
virtual memory, but I still get this prompt. I guess I can just add
more.

3) Also, some of the charts, when pasted, are abnormally large. When
running the macro again, it would be the exact size that I want.

Can someone please help me with my problem. I'm so lost.......

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Slow Macro...Takes at least 1 Hour to Run

Hi

Are you running the code from Word or Excel ?

Are the workbooks open or closed ? If closed, how do you pull the data from
the workbook.

Regards,

Per


skrev i en meddelelse
...
Okay, I didn't get to finish.....(I'm really new to this, so please
help),

I'm trying to pull a lot of different graphs and data from 8 different
excel files and paste them into word. This process is crawling and I
know it should take seconds to do. Can anyone tell me why it is so?

Here is a small portion of what I have created:


myspreadsheet.worksheets("sheet1").chartobject(1). chart.chartarea.copy
Selection.GoTo what:=wdGoToBookmark, name:="bookmarkname"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnahncedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

myspreadsheet.worksheets("Sheet").range("rangename ").copy
Selection.GoTo What:=wdGoToBookmark, Name:="NameofBookMark"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

1) The first command is just for 1 graph and is repeated for 50 other
graphs. The second is for data tables. The excel files that the macro
is extracting the Graphs and Data from are large, could this be a
reason why the macro is running so slow?

2) Sometimes I run into an error: "Disk is Full" and other times it is
not. I've increased my virtual memory and I think I have sufficient
virtual memory, but I still get this prompt. I guess I can just add
more.

3) Also, some of the charts, when pasted, are abnormally large. When
running the macro again, it would be the exact size that I want.

Can someone please help me with my problem. I'm so lost.......





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Slow Macro...Takes at least 1 Hour to Run

Hi Per,

I'm running the from Word and all of the workbooks are open.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Slow Macro...Takes at least 1 Hour to Run

Hi

Sorry, I am not so familiar with VBA in Word, try the Word group.

skrev i en meddelelse
...
Hi Per,

I'm running the from Word and all of the workbooks are open.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Slow Macro...Takes at least 1 Hour to Run

On Jan 16, 6:55 am, "Per Jessen" wrote:
Hi

Sorry, I am not so familiar with VBA in Word, try the Word group.

skrev i en ...

Hi Per,


I'm running the from Word and all of the workbooks are open.


When I read many of the posts on this site, I realize that the OP is
looking to solve a mechanical problem in Excel, when a look at
alternative solutions may suggest a way of generating the desired
outputs much more cleanly.

But about the mechanical Excel questions:

If report generation is recurrent and the data sources are static, why
are you not pasting the Excel data as links so that external data
always maps correctly into the report without the need for the macro?

Regarding alternative solutions:

If the Word document is a regular report, can you generate an Excel
report instead? If the report is for internal consumption then the
more elaborate formatting that Word offers should be relatively
unimportant.

Here's another observation that takes some effort to adopt. Which is
transitioning to an Access data base for data management. Managing
eight workbooks can be tedious but managing 8 data tables is easy.
And Access dynamic queries allow you always keep data synchronized in
a transparent way. Again, it the report has an internal audience an
Access report should be sufficient. I see posters seeking advice for
Excel workarounds to problems that can be much more simply managed
with a data base solution. I sometimes wish they would consider this
alternative tool.

I know that the OP is just starting out in Excel, but sometimes a fix
further upstream is a better solution.

SteveM
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Slow Macro...Takes at least 1 Hour to Run

I just spent ages trying to speed up the copy-paste 'Picture' method which
was so slow (and that was between two Excel workbooks). I needed to
decouple the workbook data linked to a chart hence the use of the 'Picture'
method. Eight charts took about 30 seconds.

In the end I created new charts using array data, that is effectively stored
with the chart, making it portable. Reduced the time taken to less than 2
seconds. Maybe you could consider this option?


--

Regards,
Nigel




wrote in message
...
Okay, I didn't get to finish.....(I'm really new to this, so please
help),

I'm trying to pull a lot of different graphs and data from 8 different
excel files and paste them into word. This process is crawling and I
know it should take seconds to do. Can anyone tell me why it is so?

Here is a small portion of what I have created:


myspreadsheet.worksheets("sheet1").chartobject(1). chart.chartarea.copy
Selection.GoTo what:=wdGoToBookmark, name:="bookmarkname"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnahncedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

myspreadsheet.worksheets("Sheet").range("rangename ").copy
Selection.GoTo What:=wdGoToBookmark, Name:="NameofBookMark"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

1) The first command is just for 1 graph and is repeated for 50 other
graphs. The second is for data tables. The excel files that the macro
is extracting the Graphs and Data from are large, could this be a
reason why the macro is running so slow?

2) Sometimes I run into an error: "Disk is Full" and other times it is
not. I've increased my virtual memory and I think I have sufficient
virtual memory, but I still get this prompt. I guess I can just add
more.

3) Also, some of the charts, when pasted, are abnormally large. When
running the macro again, it would be the exact size that I want.

Can someone please help me with my problem. I'm so lost.......


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Slow Macro...Takes at least 1 Hour to Run

I recently experienced such problem of slow macro , but within excel only.
You can cancel the screenupdating (put it on false), but in my case, it was
due to the option "page break preview". Once in normal view, it was running
in 55 seconds instead of 6 minutes...
--
Serge


"Nigel" wrote:

I just spent ages trying to speed up the copy-paste 'Picture' method which
was so slow (and that was between two Excel workbooks). I needed to
decouple the workbook data linked to a chart hence the use of the 'Picture'
method. Eight charts took about 30 seconds.

In the end I created new charts using array data, that is effectively stored
with the chart, making it portable. Reduced the time taken to less than 2
seconds. Maybe you could consider this option?


--

Regards,
Nigel




wrote in message
...
Okay, I didn't get to finish.....(I'm really new to this, so please
help),

I'm trying to pull a lot of different graphs and data from 8 different
excel files and paste them into word. This process is crawling and I
know it should take seconds to do. Can anyone tell me why it is so?

Here is a small portion of what I have created:


myspreadsheet.worksheets("sheet1").chartobject(1). chart.chartarea.copy
Selection.GoTo what:=wdGoToBookmark, name:="bookmarkname"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnahncedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

myspreadsheet.worksheets("Sheet").range("rangename ").copy
Selection.GoTo What:=wdGoToBookmark, Name:="NameofBookMark"
Selection.Delete
Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

1) The first command is just for 1 graph and is repeated for 50 other
graphs. The second is for data tables. The excel files that the macro
is extracting the Graphs and Data from are large, could this be a
reason why the macro is running so slow?

2) Sometimes I run into an error: "Disk is Full" and other times it is
not. I've increased my virtual memory and I think I have sufficient
virtual memory, but I still get this prompt. I guess I can just add
more.

3) Also, some of the charts, when pasted, are abnormally large. When
running the macro again, it would be the exact size that I want.

Can someone please help me with my problem. I'm so lost.......




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Slow Macro...Takes at least 1 Hour to Run

Hi Steve,

Thanks for the response. My superior doesn't want me to paste link the
charts and prefer a macro for this function. So paste link is out of
the question for me.

Also, this report will be distributed out to the Board of Directors
and Execs. so everything has to be perfect and the format is rigid.

And the workbooks that I'm working with are models and I don't think I
have the option to manage the data in access. I'm not saying that it
is impossible, I'm saying I'm not allowed. But, I will study up on
this suggestions for other projects that I have more flexability with.
Thanks.


Serge,

Thanks, I'll try that as well.
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
develop a macro which takes password protection on and off Gai Excel Discussion (Misc queries) 4 November 16th 06 06:14 AM
how do i add time to see how long my macro takes to run ernestgoh[_6_] Excel Programming 2 July 16th 06 11:05 AM
convert decimal numbers to a fraction of an hour for payroll hour Flower Excel Worksheet Functions 4 February 10th 06 07:46 PM
Time Calculation - How long a macro takes to run cdb Excel Programming 7 March 31st 05 08:51 AM
Counting how long a Macro takes to run Diane Alsing Excel Programming 2 February 7th 05 05:41 PM


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