LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.dotnet.framework.interop,microsoft.public.excel.programming
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
 
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 VBA Paste of Range with PrefixCharacter fails from VB.NET Nicholas Dreyer Excel Discussion (Misc queries) 0 April 6th 07 04:09 AM
copy range from one excel sheet to other fails. berkeleydb_user Excel Programming 0 May 17th 06 07:27 AM
PrefixCharacter Gary''s Student Excel Programming 1 March 16th 06 03:35 PM
Copy paste code fails Ron Dean[_2_] Excel Programming 0 January 17th 06 11:49 AM
Paste method fails in VBA lalu Excel Programming 4 October 14th 05 03:06 AM


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