Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having a lot of trouble manipulating XL objects from my AddIn code (A C#
Automation AddIin that serves as a UDF). I Can: Read Cell Valules Insert Comments Into Cells Call Replace() Functions on Cells\Ranges Obtain Handles to Ranges Various other things I CANNOT: Insert Data directly into a cell (without using Replace function) Insert Rows Paste Data Into a Range The sheet is NOT protected Here is a line that does nothing (no error message at all) range.EntireRow.Insert(Microsoft.Office.Interop.Ex cel.XlInsertShiftDirection.xlShiftDown, m); another ugly example: rCml.Select(); rCml.Copy(m); range.Select(); range.PasteSpecial(Microsoft.Office.Interop.Excel. XlPasteType.xlPasteAll,Microsoft.Office.Interop.Ex cel.XlPasteSpecialOperation.xlPasteSpecialOperatio nNone, false, false); again, no error message, but no result either.... this is becoming critical. thanks for any help you can offer. -- Cheers, Gregory A Jackson Portland, OR |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel UDF's (in any language) cannot change the worksheet they're in, only
return a value (or array of values). Tim "pdxJaxon" wrote in message ... I'm having a lot of trouble manipulating XL objects from my AddIn code (A C# Automation AddIin that serves as a UDF). I Can: Read Cell Valules Insert Comments Into Cells Call Replace() Functions on Cells\Ranges Obtain Handles to Ranges Various other things I CANNOT: Insert Data directly into a cell (without using Replace function) Insert Rows Paste Data Into a Range The sheet is NOT protected Here is a line that does nothing (no error message at all): range.EntireRow.Insert(Microsoft.Office.Interop.Ex cel.XlInsertShiftDirection.xlShiftDown, m); another ugly example: rCml.Select(); rCml.Copy(m); range.Select(); range.PasteSpecial(Microsoft.Office.Interop.Excel. XlPasteType.xlPasteAll,Microsoft.Office.Interop.Ex cel.XlPasteSpecialOperation.xlPasteSpecialOperatio nNone, false, false); again, no error message, but no result either.... this is becoming critical. thanks for any help you can offer. -- Cheers, Gregory A Jackson Portland, OR |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gregory,
In your Insert example, I believe the 2nd argument is the CopyOrigin, which looks like it's either "xlFormatFromLeftOrAbove" or "xlFormatFromRightOrBelow". It is not the value that you are pasting. In order to paste a row with the Insert, you'd have done something like this in the previous line of code: range("A1").EntireRow.Copy In the PasteSpecial example I believe Copy(m) clears the clipboard. In other words it should copy m into rCml, but then there is nothing to PasteSpecial. I get an error message running this in Excel though, so something is different. Also "range" is an Excel reserved word, so I'd rename that variable. hth, Doug "pdxJaxon" wrote in message ... I'm having a lot of trouble manipulating XL objects from my AddIn code (A C# Automation AddIin that serves as a UDF). I Can: Read Cell Valules Insert Comments Into Cells Call Replace() Functions on Cells\Ranges Obtain Handles to Ranges Various other things I CANNOT: Insert Data directly into a cell (without using Replace function) Insert Rows Paste Data Into a Range The sheet is NOT protected Here is a line that does nothing (no error message at all): range.EntireRow.Insert(Microsoft.Office.Interop.Ex cel.XlInsertShiftDirection.xlShiftDown, m); another ugly example: rCml.Select(); rCml.Copy(m); range.Select(); range.PasteSpecial(Microsoft.Office.Interop.Excel. XlPasteType.xlPasteAll,Microsoft.Office.Interop.Ex cel.XlPasteSpecialOperation.xlPasteSpecialOperatio nNone, false, false); again, no error message, but no result either.... this is becoming critical. thanks for any help you can offer. -- Cheers, Gregory A Jackson Portland, OR |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh yeah, that too :)
Doug "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Excel UDF's (in any language) cannot change the worksheet they're in, only return a value (or array of values). Tim "pdxJaxon" wrote in message ... I'm having a lot of trouble manipulating XL objects from my AddIn code (A C# Automation AddIin that serves as a UDF). I Can: Read Cell Valules Insert Comments Into Cells Call Replace() Functions on Cells\Ranges Obtain Handles to Ranges Various other things I CANNOT: Insert Data directly into a cell (without using Replace function) Insert Rows Paste Data Into a Range The sheet is NOT protected Here is a line that does nothing (no error message at all): range.EntireRow.Insert(Microsoft.Office.Interop.Ex cel.XlInsertShiftDirection.xlShiftDown, m); another ugly example: rCml.Select(); rCml.Copy(m); range.Select(); range.PasteSpecial(Microsoft.Office.Interop.Excel. XlPasteType.xlPasteAll,Microsoft.Office.Interop.Ex cel.XlPasteSpecialOperation.xlPasteSpecialOperatio nNone, false, false); again, no error message, but no result either.... this is becoming critical. thanks for any help you can offer. -- Cheers, Gregory A Jackson Portland, OR |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using Macros to manipulate drawn objects | Excel Discussion (Misc queries) | |||
Unshimmed Automation Addin and Shimmed COM Addin in same App Domai | Excel Programming | |||
addIn functions in automation | Excel Programming | |||
Automation COM Addin with Excel | Excel Programming | |||
Need an EXPERT in VBA and knowing how to manipulate objects on an excel sheet | Excel Programming |