Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Problem Pasting Data

I'm having a problem pasting data into Excel using code. 3 remote
users are using the spreadsheet. 2 are having the following problem,
but on the 3rd machine all works fine. All machines are using Office
XP.

I'm copying the data from a Microsoft Access crosstab query by using a
custom menu item in Access that copies all cells of the crosstab query
then opens my spreadsheet. I have a button on the spreadsheet that
runs the code which pastes the copied data then formats the sheet.
The code starts with:

Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste

The rest of the formatting code is after this.

On the 2 problem machines the code runs but fails to paste the data
copied from Access, then it formats the sheet as desired. On the
third machine the data pastes OK and the code runs as it should. To
ensure that the data was actually being copied to the clipboard on the
problem machines, I had the users open a clean blank workbook and
manually paste the clipboard data into a sheet. This worked fine, so
I know that the Microsoft Access code is copying the data to the
clipboard OK.

Strangely, after manually pasting the data into a clean workbook, the
code in my original workbook will then work and paste the data as it
should.

Is there anything that is obviously wrong with my code above that
would cause it to work on one machine but fail on 2 others?

Any help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JCS JCS is offline
external usenet poster
 
Posts: 93
Default Problem Pasting Data

Hi Wayne,

Instead of copying and pasting from Access to Excel, why not create a macro
in Access that users the TransferSpreadsheet command? Very easy to do.

John

"Wayne" wrote:

I'm having a problem pasting data into Excel using code. 3 remote
users are using the spreadsheet. 2 are having the following problem,
but on the 3rd machine all works fine. All machines are using Office
XP.

I'm copying the data from a Microsoft Access crosstab query by using a
custom menu item in Access that copies all cells of the crosstab query
then opens my spreadsheet. I have a button on the spreadsheet that
runs the code which pastes the copied data then formats the sheet.
The code starts with:

Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste

The rest of the formatting code is after this.

On the 2 problem machines the code runs but fails to paste the data
copied from Access, then it formats the sheet as desired. On the
third machine the data pastes OK and the code runs as it should. To
ensure that the data was actually being copied to the clipboard on the
problem machines, I had the users open a clean blank workbook and
manually paste the clipboard data into a sheet. This worked fine, so
I know that the Microsoft Access code is copying the data to the
clipboard OK.

Strangely, after manually pasting the data into a clean workbook, the
code in my original workbook will then work and paste the data as it
should.

Is there anything that is obviously wrong with my code above that
would cause it to work on one machine but fail on 2 others?

Any help would be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Problem Pasting Data

On Apr 2, 10:20*pm, JCS wrote:
Hi Wayne,

Instead of copying and pasting from Access to Excel, why not create a macro
in Access that users the TransferSpreadsheet command? *Very easy to do.

John


Thanks John. I hadn't thought of that. I'll give it a go.
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
Excel 2002: Problem in pasting copied data to Coda Financial Mr. Low Excel Discussion (Misc queries) 0 November 13th 06 06:10 PM
Excel 2002: Problem in pasting copied data to Coda Financial Acco Mr. Low Excel Discussion (Misc queries) 0 November 13th 06 01:47 PM
Problem with Pasting Data Addy Setting up and Configuration of Excel 0 April 26th 06 06:18 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Problem pasting numeric data from Access into Excel JP Jones Excel Discussion (Misc queries) 8 July 14th 05 03:26 PM


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