Click here to Skip to main content
16,006,006 members
Home / Discussions / C#
   

C#

 
GeneralQuestion about .NET visual inheritance and MDI apps. Pin
rolst530-Sep-04 6:41
rolst530-Sep-04 6:41 
GeneralRe: Question about .NET visual inheritance and MDI apps. Pin
Heath Stewart30-Sep-04 6:55
protectorHeath Stewart30-Sep-04 6:55 
GeneralExcel Automation question Pin
sameerhanda30-Sep-04 6:33
sameerhanda30-Sep-04 6:33 
GeneralRe: Excel Automation question Pin
Heath Stewart30-Sep-04 6:46
protectorHeath Stewart30-Sep-04 6:46 
GeneralRe: Excel Automation question Pin
sameerhanda30-Sep-04 7:17
sameerhanda30-Sep-04 7:17 
GeneralRe: Excel Automation question Pin
Heath Stewart30-Sep-04 7:54
protectorHeath Stewart30-Sep-04 7:54 
GeneralRe: Excel Automation question Pin
sameerhanda30-Sep-04 8:12
sameerhanda30-Sep-04 8:12 
GeneralRe: Excel Automation question Pin
Heath Stewart30-Sep-04 10:13
protectorHeath Stewart30-Sep-04 10:13 
Since it's a COMException, the the first thing you should do is suspect the COM server you're calling and look at the documentation.

Having done that, I see two flaws:
  1. The second parameter is ignored if the Filename refers to a local file (on the hard disk), and
  2. CopyFile is a variant of type VT_BOOL (bool), so even if you had to specify it (i.e., Filename refers to a file on a network share, for example) you need to cast it to an object which gets marshaled as a VARIANT (native type):
    object copyFile = true;
    excelApp.AddIns.Add("filename", copyFile);
    You don't need to specify the second parameter, however, if you always know the file will be on hard disk. If you know this assumption is safe, then use object copyFile = Missing.Value; instead of assigning a bool.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Software Design Engineer
    Developer Division Sustained Engineering
    Microsoft

    [My Articles]

GeneralRe: Excel Automation question Pin
sameerhanda30-Sep-04 11:08
sameerhanda30-Sep-04 11:08 
Generalpictures in textboxes Pin
vyki_c30-Sep-04 6:22
vyki_c30-Sep-04 6:22 
GeneralRe: pictures in textboxes Pin
Heath Stewart30-Sep-04 6:40
protectorHeath Stewart30-Sep-04 6:40 
GeneralReal Time Applications Pin
sreejith ss nair30-Sep-04 6:03
sreejith ss nair30-Sep-04 6:03 
GeneralRe: Real Time Applications Pin
Dave Kreskowiak30-Sep-04 7:25
mveDave Kreskowiak30-Sep-04 7:25 
GeneralRe: Real Time Applications Pin
sreejith ss nair30-Sep-04 7:30
sreejith ss nair30-Sep-04 7:30 
GeneralRe: Real Time Applications Pin
Dave Kreskowiak30-Sep-04 7:52
mveDave Kreskowiak30-Sep-04 7:52 
GeneralRe: Real Time Applications Pin
Heath Stewart30-Sep-04 9:19
protectorHeath Stewart30-Sep-04 9:19 
GeneralEvil Textboxes Width Changes When Large Fonts (C#) Pin
dbromberg30-Sep-04 5:48
dbromberg30-Sep-04 5:48 
GeneralRe: Evil Textboxes Width Changes When Large Fonts (C#) Pin
leppie30-Sep-04 7:47
leppie30-Sep-04 7:47 
GeneralRe: Evil Textboxes Width Changes When Large Fonts (C#) Pin
dbromberg30-Sep-04 8:17
dbromberg30-Sep-04 8:17 
Generalstatic variable Pin
goatstudio30-Sep-04 5:32
goatstudio30-Sep-04 5:32 
GeneralRe: static variable Pin
Dave Kreskowiak30-Sep-04 6:01
mveDave Kreskowiak30-Sep-04 6:01 
GeneralRe: static variable Pin
goatstudio30-Sep-04 6:22
goatstudio30-Sep-04 6:22 
GeneralRe: static variable Pin
Heath Stewart30-Sep-04 6:22
protectorHeath Stewart30-Sep-04 6:22 
GeneralRe: static variable Pin
goatstudio30-Sep-04 6:27
goatstudio30-Sep-04 6:27 
GeneralRe: static variable Pin
Heath Stewart30-Sep-04 6:42
protectorHeath Stewart30-Sep-04 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.