CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2002
    Posts
    56

    Unhappy URGENT !! Automating Excel (Office 97)

    Hi,
    I am automating Ms Excel (Office 97) from Vb .NET.
    Everything works fine except...
    I need to use the "paste special" functionality of Ms Excel from VB. The simple paste works ...
    eg; xlsheet.selection.paste()
    but in the case below, the code gives error..
    xlsheet.Selection.PasteSpecial(Paste:="xlValues", Operation:="xlNone", SkipBlanks:=False, Transpose:=False)

    The error is :-
    "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in microsoft.visualbasic.dll

    Additional information: PasteSpecial method of Range class failed"

    I don't have a clue as to why it is coming...
    every other thing like 'selection.copy' and 'selection.paste' is working.

    need help urgently.
    Thanks
    rajtofar
    REAL USERS HATE REAL PROGRAMMERS
    rajtofar

  2. #2
    Join Date
    Feb 2002
    Posts
    1

    Cool Please Have you got any reply


    Hello,

    Please, have you got a reply to your problem?
    In fact, actually I have this same problem. I am using office 2k
    and VB6.
    I want to use Excel paste special xlPasteValues, then xlPasteFormats.

    I use this to delete formulas from existing spread sheets.

    Thanks a lot.
    Hichem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured