|
I created an app using the VC App Wizard that is an ole client using active documents. I can insert an Excel spreadsheet and put stuff into the spreadsheet manually...fine and good. I would like to be able to programmatically set the value of cells in the spreadsheet...nothing more.
Can anyone help me with this, what I hope to be, easy problem? I know diddly about ole.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
yes you can do that..and do that rather easily..
what you have to do is to find the method in the exposed class which says something like SetCell(int row, int col, variant val)
and here u are ...u pass the cell coordinates as well as the value and you are done..
regards
safee
|
|
|
|
|
Here's an example:
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE),
vtFalse((short) FALSE);
CString strText;
if (app.CreateDispatch("Excel.Application") == TRUE)
{
app.SetVisible(TRUE);
books = app.GetWorkbooks();
book = books.Add(vtOptional);
sheets = book.GetSheets();
sheet = sheets.GetItem(COleVariant((short) 1));
range = sheet.GetRange(COleVariant("A1"), COleVariant("A1"));
m_ebCellA1.GetWindowText(strText);
range.SetValue(COleVariant(strText));
range = sheet.GetRange(COleVariant("A2"), COleVariant("A2"));
m_ebCellA2.GetWindowText(strText);
range.SetValue(COleVariant(strText));
range = sheet.GetRange(COleVariant("A4"), COleVariant("A4"));
range.SetFormula(COleVariant("=A1 + A2"));
}
I have a dialog with two edit boxes where I enter a number into each. These two numbers are plugged into two cells in Excel and their sum is plugged into a third cell.
|
|
|
|
|
Thanks for the reply. There seems to be something missing...or I am ignorant...or both
Where are these defined?
DavidCrow wrote:
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
They come from Excel9.h. This file, and its .cpp companion, are created by importing from the Excel type library.
|
|
|
|
|
Thanks. That works well, however it loads the excel app to do the operations. Do you know how I can use the same methodology to set the cells in the ole object that is inserted in my client application?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
I've not tried anything embedded.
|
|
|
|
|
In case you are interested, I found out how to do what I wanted.
clickety[^]
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hello,
I'm the designer of a small independent game called Psyscapes, and the current programmer for it (C++) has been unable to complete his task. However, he has completed about half of it, and has agreed to pass along his work to someone else and answer any questions they may have about the source code. Payment for this project will be done by a percentage of the profits after the game is complete, and there will be a contract for this project (sendable through the internet, if you can attach a picture of your signature).
Please email mail@psyscapes.com with some information about yourself if you're interested. Professional experience is a plus, but the most important thing is how quick and efficient you'll be able to get it done (expectant fans have already been waiting a long time!). I hope to make the selection by the end of this weekend, so you need to email there by Sunday, or Monday (May 5) at the absolute latest. More details will be given to you once your email is received.
I apologize if this was the wrong place for this post, I don't mean to offend anyone. Anyway, thanks for your time.
--Josh Cronkhite
mail@psyscapes.com
|
|
|
|
|
How about a website for the project? Why don't you register before posting? Are you aware that you are posting a message to the most talented programmers in the world?!?! Unless you pony up some status and can back six figures for the completion of the project, you're wasting your time here. If you want to advertise here, read this[^].
|
|
|
|
|
Give him a break! ;)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
42696C6C2053657267696F20284E4F542129 wrote:
Why don't you register before posting?
You too
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
hey dude, lose the ermine robes and walk with the peasants.
|
|
|
|
|
I am having problem registering msvcrt.dll in a client PC. An error messages says:
--------------------------
msvcrt.dll was loaded, but the DllRegisterServer entry point was not found.
DllRegisterServer may not be exported, or a corrupted version of msvcrt.dll may be in memory. Consider using PView to delete and remove it.
--------------------------
I have the same problem when registering p2sodbc.dll for Crystal Reports.
I am not sure registering msvcrt.dll is neccessary for a Windows 95 or Windows 2000 PC. Also I don't believe the files are corrupted since I copied them right from my PC.
-Elizabeth
Eilzabeth
|
|
|
|
|
msvcrt.dll isn't a COM server. Usually, you just want drop it into the system directory.
|
|
|
|
|
Thank you. But how can I know which DLLs require registering? Can you please tell me why I was having the same problem with p2sodbc.dll?
-Elizabeth
Eilzabeth
|
|
|
|
|
Any DLL that is missing the routine in question is a DLL that need not be registered.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I got it, p2sodbc.dll does not need to be registeed. Let me check with Crystal Reports on what folder p2sodbc.dll should be residing.
Eilzabeth
|
|
|
|
|
The user account most likely doesn't have admin rights. In order to register a DLL, you need admin rights to the system directory. If you try under an admin acct, it'll probably work, and after the admin registers the component, all users should have access. Hope that helps.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
As it has been mentioned that MSVCRT.dll is not a COM server. Therefore any attempt to register it will end up in the message that you are getting. And probably same reason for p2odbc.dll.
There is a gotcha in dropping this MSVCRT.dll into system32 folder. OS won't let you do that. This DLL is also used by OS. When system starts, it loads the copy of this DLL into the memory. And this is one of those DLLs that never get loaded again although you may have it in your application's folder.
The only trick to accomplish is by command line. Rename the existing MSVCRT.dll to a new name ane copy the new one there. But you only need to copy a newer version if your application absolutely needs to bcause reaplcing of MSVCRT.dll will require a reboot.
---
Softomatix
http://www.pardesifashions.com/Softomatix/default.aspx
|
|
|
|
|
I am looking to implement a button control that drops down a dialog box when clicked. Can anyone point me to an existing implementation of something like this?
Thanks,
Neal Stublen
http://www.awesoftware.com
|
|
|
|
|
Neal Stublen wrote:
...drops down a dialog box...
What do you mean by that?
|
|
|
|
|
There is some code around CodeProject.com that will dropdown a menu just below a button when the button is clicked (like the "Back" or "Forward" buttons on the Internet Explorer toolbar, or the "Views" button on the Windows Explorer toolbar).
Instead of dropping down a popup menu, I want to drop down a dialog box just under the button. When the user clicks outside the dialog box, it will go away.
Thanks,
Neal Stublen
http://www.awesoftware.com
|
|
|
|
|
Do not have the code with me but this is how I do it:
1) Create a normal dialog box.
2) Use a piture control to make line across the dialog box, where the fold will be.
3) Uncheck visable in the piture controls' properties, unless you want it visable when box is unfolded.
4) When dialog box is initialize get and save the size of the dialog box. Then get the rectangle for the piture control and use it to set the folded size (dlgRect.bottom = pictRect.top). (make you are using screen coordinates)
Use MoveWindow() to set new size.
5) You should have added a button, to the unfolded portion of you dialog, that is used to tell it to unfold (normaly called Advanced). Add a handler for that button so that when it is pressed you can resore the dialog to its' origanal size.
That is about all there is to it.
Trust in the code Luke. Yea right!
|
|
|
|
|
Thanks for the assistance, butI think I wasn't clear enough in my question...
There is some code around CodeProject.com that will dropdown a menu just below a button when the button is clicked (like the "Back" or "Forward" buttons on the Internet Explorer toolbar, or the "Views" button on the Windows Explorer toolbar).
Instead of dropping down a popup menu, I want to drop down a dialog box just under the button. When the user clicks outside the dialog box, it will go away.
Thanks,
Neal Stublen
http://www.awesoftware.com
|
|
|
|