3

I am generating an excel sheet from multiple databases and wanted at particular column to add "Tooltip" to show, from where the data is being fetched. All I want some property or method to set Tooltip of any excel cell. At the moment I tried :

objCopy.Cells[j + Convert.ToInt16(StartRow["StartRow"]), 4].Tooltip = "From First Table";

And

objCopy.Cells[j + Convert.ToInt16(StartRow["StartRow"]), 4].setAttribute("title","From SpreadSheet");
2
  • 2
    Do you mean a Comment instead of Tooltip? Excel does not have an object Tooltip for a Range. If so, try Range.AddComment. Commented Jul 10, 2015 at 16:15
  • Do you want this "tooltip" to appear on mouseover or on mouseclick? You can use comments for mouseover, and data validation message on mouseclick. What library are you using for generating Excel file? Commented Jul 11, 2015 at 20:39

1 Answer 1

1

No. Excel doesn't have tooltips. The only thing that comes close are comments.

The Range.AddComment is what you need for that.

Sign up to request clarification or add additional context in comments.

11 Comments

Hi Thanks for your reply. Can you please let me know how to use that. As of now I am using objCopy.Cells[j + Convert.ToInt16(StartRow["StartRow"]), 4].Range.AddComment("From SpreadSheet"); and it's still not working
I am getting Error while invoking Range.
{System.Reflection.TargetParameterCountException: Error while invoking Range. at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message) at CallSite.Target(Closure , CallSite , ComObject ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet]
Range is correct. I am just checking for some syntax stuff related to invoking range
Try to remove the Range in between.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.