LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Excel VBA to VB6 Conversion

There may well be problems in a stand alone Exe, I've never tried. At the
very least would require Office is installed on user's system.


In 90% of the cases in which I've used VB6, it was because the end user
might not have Office installed. So my very brief excitement about using VBA
forms in a quick and dirty VB6 app was quickly squelched. Thanks for
nothin'!

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Peter T" <peter_t@discussions wrote in message
...
Hi Nick,

I use Userforms (Forms2) without any problem at all in VB6, at least none
I've ever been aware of. Even a complex form with many controls and a lot
of
code.

Whilst there is vastly more scope with the VB form (and learning curve)
there are just a few things a userform does better. Having said that only
I've only used in a dll to be called from Excel, either as a Com-addin or
plain dll.

With the 'userform' in the designer can edit normally, add controls from
the
toolbox, etc. The only difference is the form's external size & position
units are in VB 'style'.

There may well be problems in a stand alone Exe, I've never tried. At the
very least would require Office is installed on user's system. Without
Office it would mean distributing the Forms2.dll which, if that's
possible,
I assume (?) would contravene license.

Regards,
Peter T


"NickHK" wrote in message
...
Bob,
Actually VBA forms can be imported in a VB5/6 project, but loose the form
aspect and become designers.
However, controls from the Forms2.dll are not supprted in VB5/6 and will
(probably) lead to erratic behaiour and various "Out of Memory" errors.

So your comment "userforms will need to be recut" is advisable due to the
above limitations.

NickHK

"Bob Phillips" wrote in message
...
In many ways there is little conversion that needs to be done, but
there

are
three important areas that you have to address

workbook and worksheet event code don't work in VB (although they will

still
work if embedded in an Excel workbook that you open)

userforms will need to be recut, they VBA can't be imported into VB

most importantly, you need to create an instance of Excel, or point to

an
existing instance, and qualify all books, sheets with the parent

objects,
like this

Dim oApp As Object
Dim oWB As Object
Dim oWS As Object

On Error Resume Next
Set oApp = GetObject(, "Excel.Applicatioin")
On Error GoTo 0

If oApp Is Nothing Then
Set oApp = CreateObject("Excel.Application")
End If

Set oWB = oApp.Workbooks.Open("C:\myfile.xls")

Set oWS = oWB.Worksheet("Summary")


--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my

addy)

"MB" wrote in message
...
Hi,

I have an Excel Add-in .xla file that is working fine. Would like to
convert
it to VB6 code to create a stand alone application. Is it possible to

do?
Any
help on how to start would be appreciated.

Thanks,
MB










 
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
Excel VBA to VB.NET conversion KreativeKai Excel Programming 2 March 2nd 06 03:47 AM
Excel conversion Realstar New Users to Excel 3 January 23rd 06 01:18 AM
Excel to PDF conversion in VB Paul Watkins Excel Discussion (Misc queries) 4 July 21st 05 03:55 PM
Excel conversion microsoft[_3_] Excel Programming 1 August 27th 03 01:49 AM
Excel VBA Conversion Sheela Excel Programming 0 August 20th 03 04:51 AM


All times are GMT +1. The time now is 07:50 AM.

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"