Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Excel VBA Paste of Range with PrefixCharacter fails from VB.NET

Operating System: Microsoft Windows Version 5.1 (Build
2600.xpsp_sp2_gdr.050301-1519 : Service Pack 2)

Visual Basic: MIcrosoft Visual Basic 6.3 Version 9972 VBA: Retail
6.4.9972 Forms3: 11.0.6550 (comes with Excel 2003)

The code below fails to copy the PrefixCharacter from cell "a1" to
cell "a2", yet doing the same directly from VBA code does copy the
PrefixCharacter.
_______________________________________________


With Microsoft.Office.Interop.Excel.Application.Actives heet
.Range("a1").Copy()
.Range("a2").PasteSpecial(Paste:=xlFormulas)
.Range("a2").PasteSpecial(Paste:=xlFormats)
End WIth


The following library references are used in the VB.NET project:

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\
11.0.0.0__71e9bce111e9429c\Microsoft.Office.Intero p.Excel.dll

Assembly office
C:\WINDOWS\assembly\GAC\Office\11.0.0.0__71e9bce11 1e9429c\
Office.dll

Assembly Microsoft.VisualBasic.Compatibility
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
Microsoft.VisualBasic.Compatibility.dll

Assembly System
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
System.dll

Assembly System.Data
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
System.Data.dll

Assembly System.Windows.Forms
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
System.Windows.Forms.dll

Assembly Interop.VBA
C:\vb\Nick\PlanningToolsModules\bin\
Interop.VBA.dll

Assembly Microsoft.Vbe.Interop

C:\WINDOWS\assembly\GAC\Microsoft.Vbe.Interop\11.0 .0.0__71e9bce111e9429c\
Microsoft.Vbe.Interop.dll

and the following "Imports" statements are included:


Imports Microsoft.Office.Interop.Excel
Imports Microsoft.Office.Interop.Excel.Constants
Imports Microsoft.Office.Interop.Excel.XlLookAt
Imports Microsoft.Office.Interop.Excel.XlSearchOrder
Imports Microsoft.Office.Interop.Excel.XlFindLookIn
Imports Microsoft.Office.Interop.Excel.XlDirection
Imports Microsoft.Office.Interop.Excel.XlAxisType
Imports Microsoft.Vbe.Interop
Imports Microsoft.Vbe.Interop.vbext_ComponentType


Thanks for any clues! Nick
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
Why Copy/Paste fails using Offset & Resize of myRange? [email protected] Excel Discussion (Misc queries) 3 November 21st 06 02:06 AM
Excel fails to save ChrisH Excel Discussion (Misc queries) 3 January 6th 06 01:30 PM
excel fails to launch NFEI Excel Discussion (Misc queries) 3 October 31st 05 08:13 PM
Paste a named range to another range in Excel David Jean Excel Discussion (Misc queries) 2 April 13th 05 02:02 PM
Excel Fails when add-in is selected Ron Excel Worksheet Functions 0 March 14th 05 12:18 AM


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