Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Marc
 
Posts: n/a
Default New Macro error after Office Upgrade

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default New Macro error after Office Upgrade

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Marc
 
Posts: n/a
Default New Macro error after Office Upgrade

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default New Macro error after Office Upgrade

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
Marc
 
Posts: n/a
Default New Macro error after Office Upgrade

Dave,
Worksheet is not protected. I'm copying a range, see below code example.

'Modify for File Name and Org
strFileName = "Opst_200.xls"
strOrgName = "200"

' Path to Hotel database file
Windows(strFileName).Activate
Windows.Application.ScreenUpdating = False
Application.Goto Reference:="top_dbase"
Selection.CurrentRegion.Select
Selection.ClearContents
Windows("ControlOpstat01.xls").Activate
Application.Goto Reference:="dbase"
Selection.AutoFilter Field:=1, Criteria1:=strOrgName
Selection.Copy
Windows(strFileName).Activate
Application.Goto Reference:="top_dbase"
'MsgBox Application.CutCopyMode
ActiveSheet.Paste
Selection.Name = "dbase"


"Dave Peterson" wrote:

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default New Macro error after Office Upgrade

Do you have merged cells in those ranges?

What happens if you do it manually?

Marc wrote:

Dave,
Worksheet is not protected. I'm copying a range, see below code example.

'Modify for File Name and Org
strFileName = "Opst_200.xls"
strOrgName = "200"

' Path to Hotel database file
Windows(strFileName).Activate
Windows.Application.ScreenUpdating = False
Application.Goto Reference:="top_dbase"
Selection.CurrentRegion.Select
Selection.ClearContents
Windows("ControlOpstat01.xls").Activate
Application.Goto Reference:="dbase"
Selection.AutoFilter Field:=1, Criteria1:=strOrgName
Selection.Copy
Windows(strFileName).Activate
Application.Goto Reference:="top_dbase"
'MsgBox Application.CutCopyMode
ActiveSheet.Paste
Selection.Name = "dbase"

"Dave Peterson" wrote:

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
Marc
 
Posts: n/a
Default New Macro error after Office Upgrade

Dave,

No merged cells, I tried manually and worked with no errors. I tried
replacing the StrFileName with the actual file name and still error at same
point.

"Dave Peterson" wrote:

Do you have merged cells in those ranges?

What happens if you do it manually?

Marc wrote:

Dave,
Worksheet is not protected. I'm copying a range, see below code example.

'Modify for File Name and Org
strFileName = "Opst_200.xls"
strOrgName = "200"

' Path to Hotel database file
Windows(strFileName).Activate
Windows.Application.ScreenUpdating = False
Application.Goto Reference:="top_dbase"
Selection.CurrentRegion.Select
Selection.ClearContents
Windows("ControlOpstat01.xls").Activate
Application.Goto Reference:="dbase"
Selection.AutoFilter Field:=1, Criteria1:=strOrgName
Selection.Copy
Windows(strFileName).Activate
Application.Goto Reference:="top_dbase"
'MsgBox Application.CutCopyMode
ActiveSheet.Paste
Selection.Name = "dbase"

"Dave Peterson" wrote:

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
Marc
 
Posts: n/a
Default New Macro error after Office Upgrade

Dave,
I did miss one issue when running this manually, I'm getting the following
warning on screen when opening file: Cannot find 'C:\Program Files\Microsoft
Office\Office 11\Library\MSquery\XLQuery.XLA'!Register.Dclick, which has been
assaigned to run each time[Opst_200.xls]A is opened. Continuing could cause
errors. Cancel open Yes/No button on form. I answered no when I ran my test.
I confirmed when the macro runs that the Opst_200 file has opened also via
that method.

"Marc" wrote:

Dave,

No merged cells, I tried manually and worked with no errors. I tried
replacing the StrFileName with the actual file name and still error at same
point.

"Dave Peterson" wrote:

Do you have merged cells in those ranges?

What happens if you do it manually?

Marc wrote:

Dave,
Worksheet is not protected. I'm copying a range, see below code example.

'Modify for File Name and Org
strFileName = "Opst_200.xls"
strOrgName = "200"

' Path to Hotel database file
Windows(strFileName).Activate
Windows.Application.ScreenUpdating = False
Application.Goto Reference:="top_dbase"
Selection.CurrentRegion.Select
Selection.ClearContents
Windows("ControlOpstat01.xls").Activate
Application.Goto Reference:="dbase"
Selection.AutoFilter Field:=1, Criteria1:=strOrgName
Selection.Copy
Windows(strFileName).Activate
Application.Goto Reference:="top_dbase"
'MsgBox Application.CutCopyMode
ActiveSheet.Paste
Selection.Name = "dbase"

"Dave Peterson" wrote:

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default New Macro error after Office Upgrade

I'm out of guesses.

Sorry.

Marc wrote:

Dave,

No merged cells, I tried manually and worked with no errors. I tried
replacing the StrFileName with the actual file name and still error at same
point.

"Dave Peterson" wrote:

Do you have merged cells in those ranges?

What happens if you do it manually?

Marc wrote:

Dave,
Worksheet is not protected. I'm copying a range, see below code example.

'Modify for File Name and Org
strFileName = "Opst_200.xls"
strOrgName = "200"

' Path to Hotel database file
Windows(strFileName).Activate
Windows.Application.ScreenUpdating = False
Application.Goto Reference:="top_dbase"
Selection.CurrentRegion.Select
Selection.ClearContents
Windows("ControlOpstat01.xls").Activate
Application.Goto Reference:="dbase"
Selection.AutoFilter Field:=1, Criteria1:=strOrgName
Selection.Copy
Windows(strFileName).Activate
Application.Goto Reference:="top_dbase"
'MsgBox Application.CutCopyMode
ActiveSheet.Paste
Selection.Name = "dbase"

"Dave Peterson" wrote:

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default New Macro error after Office Upgrade

It sounds like there's something happening on the worksheet_activate event
(maybe???).

This doesn't answer the question, but I think that this is equivalent to your
code:

Option Explicit
Sub testme01()

Dim Top_DBase As Range
Dim dBase As Range
Dim strFileName As String
Dim strOrgName As String

strFileName = "Opst_200.xls"
strOrgName = "200"

Set Top_DBase = Workbooks(strFileName).Names("Top_dbase").RefersTo Range
Top_DBase.ClearContents

Set dBase = Workbooks("ControlOpstat01.xls").Names("dbase").Re fersToRange

dBase.AutoFilter field:=1, Criteria1:=strOrgName

dBase.Copy _
Destination:=Top_DBase.Cells(1)

Top_DBase.Resize(dBase.Rows.Count, dBase.Columns.Count).Name = "dbase"

End Sub

Did you really meant to use "dbase" in that last portion?

Marc wrote:

Dave,
I did miss one issue when running this manually, I'm getting the following
warning on screen when opening file: Cannot find 'C:\Program Files\Microsoft
Office\Office 11\Library\MSquery\XLQuery.XLA'!Register.Dclick, which has been
assaigned to run each time[Opst_200.xls]A is opened. Continuing could cause
errors. Cancel open Yes/No button on form. I answered no when I ran my test.
I confirmed when the macro runs that the Opst_200 file has opened also via
that method.

"Marc" wrote:

Dave,

No merged cells, I tried manually and worked with no errors. I tried
replacing the StrFileName with the actual file name and still error at same
point.

"Dave Peterson" wrote:

Do you have merged cells in those ranges?

What happens if you do it manually?

Marc wrote:

Dave,
Worksheet is not protected. I'm copying a range, see below code example.

'Modify for File Name and Org
strFileName = "Opst_200.xls"
strOrgName = "200"

' Path to Hotel database file
Windows(strFileName).Activate
Windows.Application.ScreenUpdating = False
Application.Goto Reference:="top_dbase"
Selection.CurrentRegion.Select
Selection.ClearContents
Windows("ControlOpstat01.xls").Activate
Application.Goto Reference:="dbase"
Selection.AutoFilter Field:=1, Criteria1:=strOrgName
Selection.Copy
Windows(strFileName).Activate
Application.Goto Reference:="top_dbase"
'MsgBox Application.CutCopyMode
ActiveSheet.Paste
Selection.Name = "dbase"

"Dave Peterson" wrote:

That means that there was something in the clipboard.

If you had something copied, you'll see 1 (xlCopy). If you Cut something, then
you would see 2 (xlCut).

Is it the worksheet protection?

Is it the cell you're copying?

You may want to share a few more lines of code.

Marc wrote:

Dave,

I added the code before the paste and msgbox opens with a 1 showing?

The macro works fine on a Office 2000 system, try to launch on Office 2003
you get the error, so I not sure about #1 or #3 are an issue, unless some
rules have changed across versions? Let me know what you think about the
above result.

"Dave Peterson" wrote:

That one line isn't the culprit.

But there could be a few reasons...

1. Your worksheet is protected

2. Whatever you copied isn't in the clipboard at that moment.
if you add
msgbox application.cutcopymode
right before the .paste line, what do you see?

3. You're pasting into a range that can't be the same size:
Range("a:a").Copy
Range("b2").Select
ActiveSheet.Paste

(I'm guessing #2.)




Marc wrote:

We recently upgraded some PCs from Office 2000 to Office 2003, and now when
we run an Excel Macro that copies data, I am getting the following error.

Run time Error 1004 "Paste method of Worksheet class failed"

The code causing the exception error is "ActiveSheet.Paste". Is this command
no longer legal in Office 2003?? Is there some other VB command that should
be used other than "ActiveSheet.Paste" for 2003 or a security patch that is
needed?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Pretty simple question Alex Excel Discussion (Misc queries) 5 August 30th 06 02:13 PM
Missing Personal.xls in Office 2003 Upgrade Cheryl Carling Excel Discussion (Misc queries) 3 July 18th 05 01:19 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Macro not running on Office 2000, only 2003 Rob Gould Excel Discussion (Misc queries) 2 March 18th 05 08:12 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 08:34 AM.

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"