I'm running VS 2008 with Excel 2007.
Perhaps I need to clarify my question. When I'm running VSTO directly
inside of Visual Studio (as opposed to opening up the Excel solution outside
of VS), and I use Console.Writeline in my code, VS does in fact have a
Console output window, and Console.Writeline from a normal VB program running
inside of VS does write the output to the Console window. However, when I
try this from VB code in VSTO
Console.Writeline("This is a test")
I don't get any output anywhere.
To test the above, create an Excel Worksheet VSTO solution, add a button
(Button1) to the Excel spreadsheet, and Add Code the the buttion for the
Button1 Click event handler that simply says
Console.Writeline("Button1 was clicked") : Stop
Then run the solution from VS (e.g. hit F5), and click Button1. The program
should stop at the Stop statement (confirming the previous code was
executed). However, the "Button1 was clicked" does not show up anywhere that
I looked, including VS's Console, Immediate, and Command windows.
(Obviously, if I run open the Excel file outside of VS, I wouldn't expect any
output--I would like it inside of VS for debugging purposes.)
As for you comment on Debug.Print, I don't understand where to make the menu
selection you suggested. Under VS's View menu, there is no option for
"Debug". Under VBA, Debug.Print will in fact print to the VBA Immediate
window (that works fine on my system), but I'm not writing VBA, I'm writing
VB in VSTO.
--
Ed
""Jialiang Ge [MSFT]"" wrote:
> Hello Ed,
>
> Console.WriteLine does not have output because it requires a console for
> the standard I/O.
>
> Debug.Print: Please make sure that "Debug" is selected in the "Show output
> from" list of the Output window. A simple test of Debug.Print in VSTO works
> on my side. Ed, if this suggestion does not help you, would you please tell
> me your VS version and some code snippet. I will try to reproduce the
> symptom after I get these information. Thanks.
>
> Regards,
> Jialiang Ge ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> (E-Mail Removed).
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>