View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
EA EA is offline
external usenet poster
 
Posts: 28
Default Office 2000 - Office 2003

Sub IMPORT()

Dim xlApp As Excel.Application
Dim xlWbk As Excel.Workbook

Dim xlAppPv As Excel.Application
Dim xlWbkPv As Excel.Workbook

Calculate
Application.ScreenUpdating = False

Path = Range("Trading_Path").Value <----------Highlighted-------
ext = Range("Trading_Name").Value


I think I understand the difference between early and late binding.

If I put a 'Dim Path as string' at the start of the procedure and compile I
do not get the error.

However I am unclear in my mind why the code above works in either
enviroment. From which library does the String type functionality come?
And so how does the code work?

Initially thre code was written in Excel 2000 and worked. Then it was run
on an Excel 2003 machine and worked (and saved) then when the saved file was
run on a Excel 2000 PC an error message appears which says "Compile error,
cannot find project or library.

And so we are back to the missing

C:\Program Files\Microsoft Office\Office11\msoutl.olb

file.

Surely the type definitions do not come from this file - so why is it so
important.

I have advised that future cosing should be done using Option Explicit, to
force binding, but I am struggling to understand why the code worked in the
first place.

Can anyone offer any clarifictaion (espeically Peter T - many thanks for
assisting on nthis so far)