MFC 엑셀

2016. 11. 18. SincereGuy :: [MFC] 엑셀파일 읽기/쓰기 http://sincereguy.tistory.com/11 1/4 2016.11.18 검색 Total 17,035 Today 6 Yesterday 6 SincereGuy MediaLog Tag LocationLog Guestbook Admin Write [MFC] 엑셀파일 읽기/쓰기 Programing/MFC | 2011.02.27 18:52 Posted by SincereGuy MFC프로그램을 작성할때 외부파일 접근 필요시 보통 CFile클래스를 많이 이용한다. 하지만 CFile같은경우 txt파일정도는 읽기 편하지만 다른 응용프로그램파일과 연동은 힘들다. 처음 프로그램을 작성중 엑셀파일형식으로 데이터베이스가 저장되어 있을때 데이터베이스로 접근하기 위해 엑셀파일을 메모장에 복사하였다. 몇번을 그렇게 작업하던중 MFC에서 다이렉트로 엑셀파일로 접근하면 번거로움 없이 편하게 행열로 접근할 수 있을것 같았다. 그래서 CFile로 엑셀파일을 한번 열어보았는데, 양식이 달라서 제대로된 데이터 접근이 안되었다. visual studio와 엑셀이 같은 마이크로스프트 회사제품이니 서로 쉽게 연동되는줄 알았다. 찾아보니 ODBC로 어쩌구 저쩌구 설명되어 있던데 나같은 초보는 이해하기가 힘들었다. 이리저리 계속 찾아서 API를 구할 수 있었다. ExclAPI.zip 너무 이리저리 찾아서 출처를 모르겠다.ㅠ.ㅠㅋ 사용방법 먼저 위의 파일의 압축풀어 프로젝트에 추가를 시킨다. #include “XLEzAutomation.h”                            //<- 엑셀파일에 접근할 부분에 해더파일을 인크루드 해준다. char chThisPath[256]; CString strThisPath ; CXLEzAutomation dataexcel(FALSE);               // 엑셀클래스 선언 (FALSE: 처리 과정을 화면에 보이지 않는다) ///////////////////// 기본적으로 필요한 변수들 ///////////////////// GetCurrentDirectory(256, chThisPath);                                 //현재 디렉토리 위치를 구함 strThisPath.Format(“%s\\%s.xls”,chThisPath,”DataBase”); //디렉토리 위치에 엑셀파일을 지정  (ex)DataBase.xls GetModuleFileName( NULL, chThisPath, 256); //////////////////// 기본 세팅 ///////////////////// 여기까지 기본적으로 해주어야 할 상황이다. 열기, 읽기, 쓰기등 기본 함수를 알아보자. dataexcel.OpenExcelFile(strThisPath);        ///// 위에서 얻은 엑셀파일경로를 바탕으로 파일을 연다. dataexcel.SaveFileAs(strThisPath);            /////  변경된 엑셀파일을 저장한다. dataexcel.ReleaseExcel();                        /////  열었던 파일을 다 사용한 후 닫는다. CString dataexcel.GetCellValue( int 열번호 , int 행번호 );  //열번호와 행번호를 차래대로 전달하면 해당셀의 문자열을 리턴 dataexcel.SetCellValue( int 열번호 , int 행번호 , “저장할 문자열” );  // 위 행과는 반대되는 개념 위의 함수가 주로 사용하는 함수이다. (솔직히 말하면 내가 사용해본 함수^^;;;ㅋ)

“MFC 엑셀”의 180개의 댓글

  1. Cbd oil that works 2020
    I don’t know whether it’s just me or if everybody else encountering issues with
    your site. It appears as if some of the text in your posts are running off the screen.
    Can someone else please provide feedback and let me know if this is happening to them too?
    This could be a issue with my internet browser
    because I’ve had this happen previously. Thanks best cbd oil for pain http://bit.ly/3drY6lE cbd oil that works 2020 http://bit.ly/3drY6lE

  2. I really like your blog.. very nice colors & theme.

    Did you make this website yourself or did you hire someone
    to do it for you? Plz respond as I’m looking to design my own blog
    and would like to know where u got this from. kudos

  3. I just want to say I am just beginner to blogs and really liked you’re web blog. Very likely I’m want to bookmark your blog . You certainly have beneficial articles and reviews. Thanks a lot for sharing with us your website.

  4. Wonderful post. I find out something extra tough on various blog sites daily. It will always be boosting to check out content from other authors and exercise a little something from their store. I?d prefer to utilize some with the web content on my blog site whether you don?t mind. Natually I?ll offer you a link on your web blog. Thanks for sharing.

  5. Have you ever considered about including a little bit more than just your articles? I mean, what you say is fundamental and everything. However just imagine if you added some great pictures or video clips to give your posts more, “pop”! Your content is excellent but with images and clips, this blog could definitely be one of the very best in its niche. Amazing blog!

  6. *Youre so cool! I dont suppose Ive read anything like this before. So nice to find somebody with some original thoughts on this subject. realy thank you for starting this up. this website is something that is needed on the web, someone with a little originality. useful job for bringing something new to the internet!

  7. Aw, this was a really nice article. In suggestion I wish to put in composing similar to this in addition? requiring time and real initiative to make a very good write-up? but what can I say? I postpone alot and also by no means appear to get something done.

  8. I am no longer certain where you’re getting your information, however great topic.
    I needs to spend a while finding out much more or working out more.
    Thank you for great info I was looking for this info for my mission.

  9. An excellent share, I just offered this onto an associate that was doing a little evaluation on this. As well as he as a matter of fact purchased me morning meal since I discovered it for him. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for investing the time to discuss this, I really feel strongly about it and love reading more on this subject. If possible, as you end up being proficiency, would you mind upgrading your blog site with more details? It is extremely practical for me. Big thumb up for this article!

  10. Excellent blog! Do you have any tips and hints for aspiring writers?
    I’m hoping to start my own blog soon but I’m a little lost
    on everything. Would you suggest starting with a free platform like WordPress or go for a
    paid option? There are so many choices out there
    that I’m completely overwhelmed .. Any ideas?

    Kudos!

  11. Aw, this was an actually nice message. In concept I would love to put in writing such as this in addition? taking time as well as actual initiative to make a great article? however what can I say? I procrastinate alot and also by no means seem to get something done.

  12. Hi, I do believe this is an excellent web site. I stumbledupon it 😉 I may return once again since I book marked it. Money and freedom is the greatest way to change, may you be rich and continue to help others.

  13. This is the appropriate blog site for anybody that wishes to find out about this subject. You realize so much its nearly hard to suggest with you (not that I really would want?HaHa). You most definitely put a new spin on a topic thats been written about for many years. Fantastic things, simply terrific!

  14. I was more than happy to find this website. I need to to thank you for your time due to this wonderful read!! I definitely appreciated every little bit of it and I have you bookmarked to look at new things in your site.

  15. The following time I check out a blog, I hope that it does not disappoint me as high as this one. I imply, I recognize it was my choice to check out, yet I really believed youd have something intriguing to state. All I hear is a bunch of whimpering concerning something that you could deal with if you werent also active looking for interest.

  16. A person necessarily help to make critically posts I would state. This is the first time I frequented your web page and so far? I surprised with the analysis you made to make this particular publish amazing. Wonderful activity!

  17. Heya i am for the first time here. I came across this board and I to find It truly useful & it helped me out a lot. I’m hoping to provide something again and help others such as you helped me.

  18. I’m impressed, I must say. Truly rarely do I encounter a weblog that’s both educative and entertaining, and let me tell you, you’ve got hit the nail around the head. Your concept is outstanding; the catch is a thing that insufficient persons are speaking intelligently about. I am happy which i found this at my try to find something relating to this.

  19. A remarkable share, I simply offered this onto a colleague that was doing a little evaluation on this. And also he in fact got me breakfast because I found it for him. smile. So let me rephrase that: Thnx for the reward! Yet yeah Thnkx for spending the time to review this, I feel strongly regarding it as well as love reading more on this subject. If possible, as you end up being competence, would you mind updating your blog site with more details? It is very useful for me. Huge thumb up for this article!

  20. I?m pleased, I need to say. Really seldom do I come across a blog site that?s both educative and amusing, as well as let me inform you, you have struck the nail on the head. Your idea is exceptional; the issue is something that insufficient people are talking smartly around. I am very delighted that I came across this in my search for something relating to this.

  21. I simply want to say I am newbie to blogging and site-building and definitely loved your blog site. Probably I’m likely to bookmark your site . You surely come with remarkable posts. Cheers for sharing your blog site.

  22. Fantastic beat ! I would like to apprentice at the same time as you amend your web site, how can i subscribe for a blog web site? The account helped me a appropriate deal. I have been tiny bit acquainted of this your broadcast offered vibrant transparent concept

  23. Thanks for your fascinating article. Other thing is that mesothelioma cancer is generally brought on by the breathing of dust from asbestos, which is a positivelly dangerous material. It’s commonly found among staff in the building industry who definitely have long experience of asbestos. It is caused by moving into asbestos protected buildings for a long time of time, Your age plays a huge role, and some individuals are more vulnerable for the risk as compared with others.

  24. I just like the helpful information you supply on your articles. I’ll bookmark your weblog and check once more here frequently. I am relatively sure I’ll be informed lots of new stuff right here! Best of luck for the next!

  25. I simply want to say I am beginner to blogging and site-building and definitely liked your web page. Probably I’m likely to bookmark your blog post . You amazingly have great writings. Appreciate it for revealing your blog site.

  26. hello there and thanks for your information – I have definitely picked up something new from proper here. I did then again experience a few technical points the usage of this web site, since I skilled to reload the site lots of times prior to I could get it to load correctly. I have been wondering in case your web hosting is OK? Now not that I’m complaining, but slow loading circumstances times will sometimes impact your placement in google and could injury your quality score if ads and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I am adding this RSS to my e-mail and could look out for much more of your respective exciting content. Ensure that you update this once more very soon..

  27. After I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a remark is added I get four emails with the same comment. Is there any manner you possibly can remove me from that service? Thanks!

  28. Hi there. Very cool site!! Guy .. Beautiful .. Wonderful .. I will bookmark your website and take the feeds additionally…I am glad to locate so much useful info right here in the article. Thanks for sharing…

  29. An impressive share, I just given this onto a colleague who was doing somewhat analysis on this. And he actually bought me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the treat! However yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love reading more on this topic. If doable, as you turn into experience, would you mind updating your blog with extra particulars? It is extremely useful for me. Large thumb up for this blog put up!

  30. I have learned a few important things as a result of your post. I’d personally also like to state that there will be a situation in which you will obtain a loan and don’t need a co-signer such as a Federal Student Aid Loan. However, if you are getting that loan through a traditional loan company then you need to be made ready to have a co-signer ready to assist you. The lenders will probably base that decision on the few variables but the greatest will be your credit score. There are some creditors that will as well look at your job history and decide based on this but in many cases it will depend on your rating.

  31. Great beat ! I would like to apprentice even as you amend your site, how could i subscribe for a blog website? The account aided me a applicable deal. I had been a little bit familiar of this your broadcast provided brilliant clear idea

  32. Oh my goodness! a fantastic article dude. Thanks a lot Even so We are experiencing issue with ur rss . Don’t know why Not able to sign up for it. Perhaps there is anybody acquiring identical rss issue? Anyone who knows kindly respond. Thnkx

  33. I’m impressed, I have to admit. Truly rarely will i encounter a blog that’s both educative and entertaining, and without a doubt, you have hit the nail on the head. Your concept is outstanding; the problem is something that too few folks are speaking intelligently about. I’m delighted that we came across this within my seek out some thing relating to this.

  34. What i don’t understood is in reality how you’re not actually much more well-preferred than you might be now. You’re so intelligent. You realize therefore considerably relating to this topic, made me personally believe it from numerous various angles. Its like women and men are not involved unless it is one thing to accomplish with Woman gaga! Your personal stuffs outstanding. Always handle it up!

  35. Hey there, I think your site might be having browser compatibility issues. When I look at your blog site in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, amazing blog!

  36. Hello There. I found your blog using msn. This is an extremely well written article. I’ll be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback.

  37. Hello There. I discovered your weblog using msn. That is a really neatly written article. I’ll make sure to bookmark it and return to learn extra of your useful information. Thanks for the post. I’ll certainly return.

  38. I’ve been browsing online more than 3 hours lately, yet I by no means discovered any attention-grabbing article like yours. It is lovely worth sufficient for me. In my view, if all website owners and bloggers made good content as you probably did, the internet will probably be much more useful than ever before. “Perfection of moral virtue does not wholly take away the passions, but regulates them.” by Saint Thomas Aquinas.

  39. An intriguing discussion is definitely worth comment. There’s no doubt that that you need to publish more on this issue, it might not be a taboo subject but typically folks don’t discuss these issues. To the next! Kind regards!!

  40. You can certainly see your enthusiasm within the work you write. The arena hopes for more passionate writers such as you who are not afraid to mention how they believe. Always go after your heart.

  41. Definitely believe that which you stated. Your favorite reason seemed to be on the web the simplest thing to be aware of. I say to you, I certainly get irked while people consider worries that they plainly do not know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks

  42. I have realized some considerations through your blog post. One other stuff I would like to talk about is that there are numerous games on the market designed specifically for toddler age young children. They include pattern acknowledgement, colors, dogs, and styles. These generally focus on familiarization instead of memorization. This keeps little ones occupied without having a sensation like they are studying. Thanks

  43. Does your blog have a contact page? I’m having a tough time locating it but, I’d like to shoot you an email. I’ve got some ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it grow over time.

  44. Can I just say what a reduction to seek out someone who truly knows what theyre speaking about on the internet. You definitely know the best way to carry an issue to mild and make it important. More people need to read this and perceive this aspect of the story. I cant imagine youre no more widespread since you positively have the gift.

  45. Another thing I have really noticed is the fact that for many people, bad credit is the consequence of circumstances beyond their control. By way of example they may happen to be saddled having an illness so they really have large bills for collections. It might be due to a job loss or the inability to do the job. Sometimes divorce process can truly send the budget in an opposite direction. Thank you for sharing your thinking on this blog.

  46. Pretty nice post. I just stumbled upon your blog and wished to say that I have really enjoyed surfing around your blog posts. In any case I’ll be subscribing to your feed and I hope you write again very soon!

  47. Simply want to say your article is as astounding. The clearness in your post is just nice and i can assume you are an expert on this subject. Well with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please continue the gratifying work.

  48. Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your website? My website is in the very same niche as yours and my users would genuinely benefit from a lot of the information you provide here. Please let me know if this alright with you. Thank you!

  49. Woah! I’m really digging the template/theme of this website. It’s simple, yet effective. A lot of times it’s difficult to get that “perfect balance” between superb usability and appearance. I must say that you’ve done a fantastic job with this. Additionally, the blog loads very fast for me on Opera. Outstanding Blog!

  50. Youre so cool! I dont suppose Ive read something like this before. So good to search out any individual with some original ideas on this subject. realy thanks for beginning this up. this website is one thing that is needed on the internet, somebody with a bit of originality. helpful job for bringing one thing new to the internet!

  51. Hiya, I am really glad I have found this information. Nowadays bloggers publish only about gossips and web and this is actually frustrating. A good website with interesting content, this is what I need. Thank you for keeping this web site, I will be visiting it. Do you do newsletters? Can’t find it.

  52. 핑백: best remixes

  53. An intriguing discussion may be valued at comment. I do think you should write regarding this topic, may well certainly be a taboo subject but usually individuals are too few to speak on such topics. Yet another. Cheers

  54. Good day! This is kind of off topic but I need some advice from an established blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to start. Do you have any points or suggestions? Appreciate it

  55. A lot of the things you state happens to be supprisingly appropriate and that makes me ponder the reason why I had not looked at this with this light before. This particular piece truly did switch the light on for me as far as this specific topic goes. Nevertheless at this time there is actually just one factor I am not too comfortable with so whilst I make an effort to reconcile that with the actual core idea of the issue, permit me see what the rest of the subscribers have to point out.Nicely done.

  56. Good web site! I truly love how it is simple on my eyes and the data are well written. I’m wondering how I could be notified whenever a new post has been made. I have subscribed to your RSS which must do the trick! Have a great day!

  57. Hey would you mind letting me know which hosting company you’re utilizing? I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot quicker then most. Can you recommend a good internet hosting provider at a fair price? Thanks a lot, I appreciate it!

  58. What i do not realize is in truth how you’re not really a lot more well-preferred than you may be now. You are very intelligent. You realize therefore significantly in relation to this matter, produced me for my part consider it from a lot of numerous angles. Its like women and men are not involved until it is one thing to do with Woman gaga! Your own stuffs nice. Always care for it up!

  59. I’m impressed, I have to say. Actually rarely do I encounter a blog that’s both educative and entertaining, and let me let you know, you’ve hit the nail on the head. Your concept is excellent; the problem is one thing that not sufficient people are talking intelligently about. I’m very joyful that I stumbled throughout this in my seek for something regarding this.

  60. I really like your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to construct my own blog and would like to find out where u got this from. thanks a lot

  61. Howdy! This is kind of off topic but I need some advice from an established blog. Is it very difficult to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about creating my own but I’m not sure where to begin. Do you have any tips or suggestions? With thanks

  62. I actually wanted to construct a simple message in order to express gratitude to you for the superb ideas you are posting here. My particularly long internet research has finally been recognized with pleasant insight to exchange with my close friends. I ‘d admit that we site visitors actually are undoubtedly blessed to exist in a very good place with many perfect professionals with great tips. I feel extremely lucky to have encountered the web site and look forward to many more pleasurable minutes reading here. Thank you once more for all the details.

댓글 남기기