workbook.Worksheets.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value); The MS example was incomplete. The line above works.
Robert Ernst
Posts
-
Adding data to a new worksheet in an existing workbook c# -
How do I set TBS_ENABLESELRANGE on a .NET TrackBarHi All I want to set/control a selection range on a System.Windows.Forms.TrackBar. I think that can be accomplished by setting TBS_ENABLESELRANGE, but I can't find a property or method to set the value. Can someone tell me how to configure the TrackBar to select/display a range? If so, how do you read the range back? Thanks Robert Ernst
-
Exporting enum types to a COM DLLBINGO!! That was it. My enum definition wasn't inside the library TEST11Lib {} declaration. Once I placed it inside the library {} block it worked. Thanks so much for your help! Robert Ernst codeproject@theernsts.org
-
Exporting enum types to a COM DLLI've tried placing the enum in the .idl file, but the type still doesn't show up in the DLL, based on browsing with the Object Viewer I've inserted the enum in the .idl file both manually, and using attributes: So I have: File: employee.cpp #include [ module(dll, name = "TestEmployee", helpstring = "TestEmployee 1.0 Type Library") ]; [ emitidl ]; [dual] __interface IEmployee : IDispatch { [id(1)] HRESULT DoWork(BSTR bstrTask); }; [export] enum Status {EMPLOYEED, UNEMPLOYEED} Status_t; File:employee.idl ... [ uuid(38884C05-8FF2-3A53-83D3-837E34D61785), dual ] #line 27 "c:\\samples\\com\\employee.cpp" interface IEmployee : IDispatch { #line 29 "c:\\samples\\com\\employee.cpp" [id(1)] HRESULT DoWork([in]BSTR bstrTask); }; #line 33 "c:\\samples\\com\\employee.cpp" enum Status { EMPLOYEED = 0, UNEMPLOYEED = 1, }; The linker command is: cl employee.cpp /LD /link /IDLOUT:employee.idl Am I missing something in the Linker command? Thanks Robert Ernst
-
Exporting enum types to a COM DLLHi I'm very new to the Windows/COM development environment (coming from embedded/Unix). I'd like to create a COM/DLL (using C++) that contains and exports an enum type. I want the enum type to show up in the Visual Studio Object browser after I add the DLL to the "References" folder in the client application. I've used "[export]" before the enum in the header file. I've also tried including the header file in the serverdll.idl file. So far the enum hasn't showed up in the Object Browser. Any help or suggestions would be appriciated. Thanks Robert Ernst codeproject@theernsts.org