LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Passing a string to excel from a C app

I'm trying to add some simple excel automation to my C app. I found
some C++ code that I was able to modify to do what I want, but that code
won't link to my C app, and I can't convert the app to C++ just for this.

I found an article with a tiny 'OLE Automation from a C App' code sample
that works in my app at:
http://support.microsoft.com/kb/181473
but that sample simply starts Excel and sets 'visible'. I need to do a
little (not much) more, passing in file paths and macro names, etc.

Using the C sample as a template, I'm trying to convert the C++ sample
to C. The C sample has code to pass an integer parameter, but I need to
be able to pass in file paths as strings. The C++ sample does this by
converting them to BSTR's (VB string? OLE string?) and passing them as
VT_BSTR. Will Excel accept string parameters as VT_LPSTR, or do I have
to pass them as BSTR's. If so, can anybody provide a code snippet to
create a BSTR from a normal C string?

Thanks,
Rob
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Query String into MS Excel napval Excel Programming 0 June 20th 07 10:19 PM
Passing Query String into MS Excel napval Excel Discussion (Misc queries) 0 June 19th 07 06:04 AM
Passing a String in Array to Range as String [email protected] Excel Programming 2 September 1st 04 01:13 AM
string passing to DLL Christoph Wirz Excel Programming 1 February 20th 04 02:40 PM
PASSING A STRING VALUE Sirron Excel Programming 2 August 26th 03 06:40 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"