I doubt there is much else I can offer.
the code is generic enough that it should work in any version of excel.
Create a new workbook in xl2000 and try it in that.
I suspect it is some environmental factor that is causing the problem -
freeze ups sometimes related to Sheet level events and possibly calculation.
The sheet protection scheme in xl2000 is much less sophisticated/much more
restrictive than that in xl2002 and later - so I assume you don't have the
sheets protected.
--
Regards,
Tom Ogilvy
"ZipCurs" wrote:
> Tom,
>
> Thanks for the quick response. The code you provided me works fine on the
> Excel 2002 SP3, but not on 2000. Worth note is that the error dialog changes
> from "Method 'Paste' of object '_Worksheet' failed" to "Method 'Cut" of
> object 'Range' failed" with the new code.
>
> I took a look at the Tools=>References and did not see anything of interest
> to my untrained eye.
>
> Two points worth noting:
> - With the original and new code, when the code fails, Excel is frozen.
> - With the original code, if I stop the code before ActiveSheet.Paste, and
> manually paste the cut range, it works fine, although it does seem to create
> a whole new set of formating problems, which I have not dug into.
>
> Any further help would be greatly appreciated.
>
> "Tom Ogilvy" wrote:
>
> > Try it like this:
> >
> >
> >
> > Picture_Column = NumberofCategories + 6
> > Range("E3").Cut Sheets("All Concepts") _
> > .Cells(3, Picture_Column)
> >
> >
> > If you still have problems, you may have a missing reference in your
> > workbook. After the error, go into the VBE with your project as the
> > activeproject (selected in the project window) and go to Tools=>References
> > (may have to hit reset first) and see if one of your references is marked as
> > MISSING. If so, you need to clear this up.
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >
> > "ZipCurs" wrote:
> >
> > > I have a number of macros which run just fine on the computer that I
> > > generated them on. This computer has Excel version 2002 SP3. The code fails
> > > on a simple operation when I run the code on another machine with Excel
> > > version 2000. The section of code is:
> > >
> > > Range("E3").Select
> > > Selection.Cut
> > > Picture_Column = NumberOfCategories + 6
> > > Sheets("All Concepts").Cells(3, Picture_Column).Select
> > > ActiveSheet.Paste
> > >
> > > Range("E3") contains a button and scroll bar that I want to move to another
> > > location. Is the issue as simple as the difference in Excel versions or is
> > > there something subtle I am missing.
> > >
> > > Thanks in advance for your help.
|