Link to home
Create AccountLog in
Avatar of john_hollings
john_hollingsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Visual Basic 2008- and Excel 2003 coding

I have a question about Visual Basic 2008 (Visual Studio 2008).

I have developed a EXCEL 2003 application complete with user forms, macro ect. And this works as intended. But when it runs from Auto_Open it still and XL workbook and sheets.

I have now installed VB and have coded a user form but how do I get the VD user form control button to read and copy values from the VB to the xl worksheet(#) in and from the correct cell.

Is this the way the way forward or should I be coding everything in VB. I have tried this and can not seem to add an xl workbook to me Window Project which has the user form.

Are there any tutorials for VB 2008 which include interfacing xl within the Windows Form Application.

John
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

For what I have read in your question, you have developed an VSTO - Visual Studio Tools for Office project (http://msdn.microsoft.com/en-us/office/aa905533.aspx) and now you want to create an *.exe file and you cannot add any worksheet in your project.
Is that it ?
Avatar of john_hollings

ASKER

In a word Yes, The VSTO is just a user form, the MS XL 2003 workbook has all the calculations and resualts in cells, inportant cells are Named within XL.

I want the VSTO userForm Button (When clicked)to read from the XL workbook a Value from a named cell and enter it into a TextBox on the VSTO form.

It is hard to explane, if you know of any exsampls or tutorials that for Windows Application that uses VD 2008 to access a Excel workbbok, would be great.

Thanks for your input.


You have allot of nice links like

Home Page of VSTO
http://msdn.microsoft.com/en-us/office/aa905533.aspx 
VSTO Blog
http://blogs.msdn.com/vsto2/
 
 But if you clarify your question maybe I can help you more.
Thanks again for you info.
I have a working MS Excel 2003 VBA application; it starts from Auto_Open macro calling a userForm which has a number of command bottoms, labels and textboxes etc.
But it is still Excel and that is what the user sees. I want to convert this to a VB 2008 Windows Application, compile it to an exe file for distribution.
When this is opens in windows the only thing the user sees is the VB form (just like any other windows app), all data and calculations are performed within the original excel application which should remain hidden from the user.
I have created a new VB user form and now need to link all the operations to the excel (VBA) macros.
e.g. one of the macros uses RandBetween and generates a number between 1 and 90 each time the cmdBut (Next Number) is clicked, but it checks to see it that new number has been used already if so pick a new number if not use it.
Does this make sense to you?
John
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Thanks for you help, I have awarded the points, althrough I am still having problems, but your info and links are helping