Re: VB 6.0 to Launch excel



Try writing snipets of code first in VBA before VB6

I put in xl.app.xlbook.RunAutoMacros Auto_Open but it does not work.

is there really a dot in 'xl.app', assuming not try

xlApp.xlbook.RunAutoMacros xlAutoOpen

xlAutoOpen is a named constant value 1

I am not sure what late binding is. Can you tell me?

Briefly, if you set a reference to Excel in your VB6 (Project > References)
to "Microsoft Excel ver,0 Object Library"
you will have early binding. In developing, one advantage is you will get
all the intellisense and would have seen xlAutoOpen appear in a dropdown
after typing the space after RunAutoMacros. Also you can fully declare
objects, eg
Dim wb As Excel.Workbook

If you are unable to set the reference to the earliest version of Excel your
app will be used with, remove the defence and use late binding. You would
also have to change all named constants like xlAutoOpen to their intrinsic
values, in this case 1&.

Also would need to change all -
Dim xlThing As Excel.SomeThing to
Dim objThing as Object

Regards,
Peter T

"Jason V" <JasonV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7250D22E-10EF-4A76-A2CD-ACC04DF54B46@xxxxxxxxxxxxxxxx
Peter, thank you for your response I am a little late it getting back on
it.
I am not sure what late binding is. Can you tell me?

I put in xl.app.xlbook.RunAutoMacros Auto_Open but it does not work.
the error says that the object does not support this property or method.

Auto_open is the name of the procedure in excel and all it does in
quoteform.show,
How can I do this in my exe?
Thank You

--
Jason V


"Peter T" wrote:

Hi Jason,

xlApp.myWB.RunAutoMacros xlAutoOpen ' 1 if using late binding

or put your code in the workbook open event.

Or, if your xls open event code is only for use in conjuction with your
exe,
the open code could go in your exe. Maybe other vba code too.

Regards,
Peter T

"Jason V" <JasonV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B7A44CBA-803C-4F56-9788-A7354D22081A@xxxxxxxxxxxxxxxx
sI am using VB 6.0 to launch excel just to make it look more
profeesional
to
use an .exe for the end user. In one of the threads it stated that
excel
vba
can not be compiled ino an exe so use VB to launch excel. My problem
is
that
when I open an excel document the enable macros is not set and my
Auot_Open
routine which shows my form does not run.

Any help on how to do this?

--
Jason V





.



Relevant Pages

  • Re: Extra Workbook Security via 3rd Party Software
    ... I thought about moving the project to VB6. ... "Peter T" wrote in message ... You could automate a hidden instance of Excel in which to maintain and process your data further. ... "Dennis Tucker" wrote in message ...
    (microsoft.public.excel.programming)
  • Re: Excel 2003 automation add-in Extensibility.dll deployment
    ... Office and Excel as you would in say VB6. ... "Peter T" wrote: ... language and application was the addin written in. ...
    (microsoft.public.excel.programming)
  • Re: Need help with SeriesCollection Object Please !
    ... Well Peter your explanation of my questions make sense and are sound answers. ... You seem very experienced with Excel and VBA:) ... Function GetSourceSheet(sFmla As String, sWSname, sFile As String) As ... ran my code on certain other charts sometimes it would return ...
    (microsoft.public.excel.programming)
  • Re: OLE (XLS) question ABOUT: how to display a sheet
    ... when i click on 'OLE1.Object.Sheets(2).Select' it goes to sheet2 in Excel but the sheet in VB6 OLE1 remains unchanged ... Microsoft Online Community Support ...
    (microsoft.public.vb.controls)
  • Re: VB 6.0 to Launch excel
    ... Jason V ... "Peter T" wrote: ... Dim xlapp As Excel.Application 'The Excel application object ...
    (microsoft.public.excel.programming)

Loading