Recorded macro won't run

G

Guest

I recorded a simple macro to copy data from a worksheet and paste it into a
new blank worksheet. In the recorded code was the line:

Application.Run Range("ScOnWindow")

When I ran the code, I got an error on this line. Normally I remove these
"sconwindow" lines from the code anyway, but it concerns me that something I
just recorded will not run. Am I missing a reference library or something?
It will also crash on the following recorded line:

Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Any help would be appreciated! Thanks!
 
G

Guest

It has to do with Showcase Query and it is really not necessary for whatever
you are doing. Just confirm that you have your Showcase query menu and you
are good to go. If you do not have the menu then you can just re-boot your
Excel and it will come back...
 
G

Guest

Thanks for you quick response, Jim. My showcase menu is there, so that's all
good. But even if I remove that line and run the macro, the other recorded
line crashes. This one:

Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

I get runtime error 1004:
Pastespecial method of range Class failed.
 
D

Don Guillett

Post the rest of your macro. Somehow you may have selected something that
took your copy away.
 
G

Guest

Here is the macro:

ActiveCell.Range("A1:D28").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
 
G

Guest

A couple of possible problems but it is hard to fix without seeing the rest
of the code. Post the entire macro and we can take a look.
 
G

Guest

Well, gee whiz! Guess they though we wouldn't need that one anymore!

Thanks for all your help. I appreciate it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top