|
-
Dec 18th, 2008, 09:02 AM
#1
Thread Starter
PowerPoster
unable to install on target machines
i developed an application in VB6
I have reference to the components -> calender control 11
i have reference to the MSexcel 11 object library
used P&D wizard of visual studio to create setup files
the problems are
unable to install on PC with windows XP sp(2) & MSoffice _
object library 10
errors are
(1) unable install since the files are older version
(2) file missing regsur.exe
(3)can not load c:/windows/inf/other.exe
(4) can not find c:/windows/sys32/conf/
(5) can not find c:/windows/sys32/con/win.exe
...........................
but the set up works fine in my system
advise please..
-
Dec 18th, 2008, 09:59 AM
#2
Re: unable to install on target machines
You should not be using the Calendar control with VB6, due to Licence restrictions and various bugs when used outside of Office apps.
Excel might not be an issue, but if it is you can work around it fairly easily by changing to Late Binding (for more info see my Excel Tutorial, link in my signature).
I have no idea why you are getting errors 2 to 5, those things don't seem relevant.
-
Dec 18th, 2008, 10:27 AM
#3
Thread Starter
PowerPoster
Re: unable to install on target machines
Thanks the first one i have done it , i changed my code to late binding one problem exists
sub myapp()
dim xls as object
set xls = createobject("excel.application")
xls.visible =true
xls.windowstate = xlminimized ' here this code not working
''
''
''
set xls = nothing
end sub
(2) kindly advise any alternative for calender control compatible with vb6.
-
Dec 18th, 2008, 10:35 AM
#4
Re: unable to install on target machines
1) Hopefully by "not working" you mean that you got the error "Variable not defined". If not, make sure you add Option Explicit.
You need to declare the constants in your program, as you can no longer get them via the reference. My tutorial has a link to a module which contains nearly all of the Excel constants, so you just need to add it to your project.
2) Alternative controls are explained in the article What controls can I use to input a date/time? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)
-
Dec 18th, 2008, 11:39 AM
#5
Thread Starter
PowerPoster
Re: unable to install on target machines
exactly currect
i used option explicit it works fine but
.Range("o1").Cells.HorizontalAlignment = xlRight
xlright, and as well as xlleft constants are making trouble as
variable not declared
-
Dec 18th, 2008, 11:53 AM
#6
Re: unable to install on target machines
Have you declared those constants in your program? (or added the module I referred to, which declares them and many more?)
-
Dec 20th, 2008, 11:58 AM
#7
Thread Starter
PowerPoster
Re: unable to install on target machines
sorry for delay..
no i have not declared any constants.
xlright & xlleft are as those defined with in vba.
if with reference set to excel library this problem not raising
with out reference this problem as variable not defined raising.
-
Dec 20th, 2008, 12:20 PM
#8
Re: unable to install on target machines
They are not defined in VBA, they are defined in Excel - so without a reference to Excel, you need to declare them yourself.
The easiest way to do that (as I've mentioned in my previous two posts) is to add the pre-written module which declares them for you.
-
Dec 20th, 2008, 09:04 PM
#9
Re: unable to install on target machines
I can't think of a good reason why you couldn't use the Excel type info via a reference to get those named constants. You just need to declare all of the object As Object and create them via CreateObject() I'd think.
That's why nobody ever created an XLnncons.bas or constants-only XLnn.tlb after Office 97: VB5 no longer needed them.
OFF: "Built-in Constants in Visual Basic for Applications" (WC0993)
So...
I'd think you could develop against the Office 2000, 2003, etc. type reference (avoiding anything too new or too old). You just need to be disciplined and always late-bind all of the objects.
Always seemed to work for me.
-
Dec 20th, 2008, 10:45 PM
#10
Thread Starter
PowerPoster
Re: unable to install on target machines
thanks for your lots of advises.
finally i would like to know
(1) when ever i am referencing some library during design time is it use full only for programing and works fine only in my system or equivalent.
(2) on installing the application (using p&d vb6) the DLL / CAB files which transfers into target system can't it make any job if the target system uses the lesser version of object library i refered. (because the package i created includes one EXCEL.exe alse)
(3) why is this !
xls.windowstate = 1 ' works fine
xls.windowstate = xlminized ' causes error some spell mistake is there but in my application i typed correctly.
replay to this will help me great.
-
Dec 20th, 2008, 11:30 PM
#11
Re: unable to install on target machines
When you use early binding your program is using a specific COM interface to the component or "automated" EXE (such as Excel). New versions of Excel break binary compatibility and those interfaces and their classId values no longer match your program. Late binding gets around most of this at some price in performance.
Using early binding and late binding in Automation
You can't include Excel.exe because (a.) it isn't complete in itself and (b.) it isn't legal to - licensing restrictions.
As for the last issue: yes you have to spell it correctly, and furthermore it has to be defined. It can get defined two ways: a Const or Enum in your program, or your program has a reference to the Excel typelib (which is embedded within Excel.exe in more recent versions of Excel).
-
Dec 20th, 2008, 11:50 PM
#12
Thread Starter
PowerPoster
Re: unable to install on target machines
Thanks .
is there any list of integer values equivalent of excel constants
like one i got it by your reference
xlcenter = -4108 ' peculiar sir
because it is working
-
Dec 21st, 2008, 09:30 AM
#13
Re: unable to install on target machines
Click the link in post #9 (which is the same link I've tried to get you to look at a few times), and download the file.
Run it, and it will extract a few .bas files. Add the XL one to your project - it defines all of the constants for you, so you don't need to do anything else.
-
Dec 22nd, 2008, 04:17 AM
#14
Thread Starter
PowerPoster
Re: unable to install on target machines
Thanks a lot sir,
it worked fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|