Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Excel add-in

Excel add-in

Scheduled Pinned Locked Moved C#
csharpvisual-studiocomhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Muammar
    wrote on last edited by
    #1

    Hi, I have this simple Excel add-in project based on the standard VS template, however, I cannot call the below test() function from Excel VBA.

    \[Guid("9E88FA9A-4E7D-4bba-8D94-439BFA2B0AEC")\]
    
    \[ClassInterface(ClassInterfaceType.AutoDual)\]
    \[ComVisible(true)\]
    public class MyFunctions
    {
        public void test()
        {
            Microsoft.Office.Interop.Excel.Application xlsApp = new ApplicationClass();
            Worksheet ws = (Worksheet)xlsApp.ActiveSheet;
            ws.Cells\[1, 1\] = "Edited by C#";
        }
    

    Please help, Thanks.

    Richard Andrew x64R 1 Reply Last reply
    0
    • M Muammar

      Hi, I have this simple Excel add-in project based on the standard VS template, however, I cannot call the below test() function from Excel VBA.

      \[Guid("9E88FA9A-4E7D-4bba-8D94-439BFA2B0AEC")\]
      
      \[ClassInterface(ClassInterfaceType.AutoDual)\]
      \[ComVisible(true)\]
      public class MyFunctions
      {
          public void test()
          {
              Microsoft.Office.Interop.Excel.Application xlsApp = new ApplicationClass();
              Worksheet ws = (Worksheet)xlsApp.ActiveSheet;
              ws.Cells\[1, 1\] = "Edited by C#";
          }
      

      Please help, Thanks.

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      Please state why you can't call the function. Any error message?

      The difficult we do right away... ...the impossible takes slightly longer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups