Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / April 2007



Tip: Looking for answers? Try searching our database.

Paste with PrefixCharacter fails from VB.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nicholas Dreyer - 04 Apr 2007 08:19 GMT
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

The folowing equivalent in VBA will paste the PrefixCharacter from any
cells in "ActiveRange", but the VB.NET code below ends up without any
PrefixCharacter transfered to the target:

ActiveRange.Copy()
TargetPin.PasteSpecial(Paste:=xlFormulas)
TargetPin.PasteSpecial(Paste:=xlFormats)

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

Assembly Microsoft.Office.Interop.Excel
    C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\
    11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll
   
Assembly office
    C:\WINDOWS\assembly\GAC\Office\11.0.0.0__71e9bce111e9429c\
    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.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
Jan Hyde - 04 Apr 2007 08:57 GMT
gurfle@oz.net (Nicholas Dreyer)'s wild thoughts were
released on Wed, 04 Apr 2007 07:19:30 GMT bearing the
following fruit:

>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
>
>The folowing equivalent in VBA will paste the PrefixCharacter from any
>cells in "ActiveRange", but the VB.NET code below ends up without any
>PrefixCharacter transfered to the target:

This group is for VB6 and below, you need one of the groups
with 'dotnet' in the name.

J
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.