View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 19
Default Opening a Workbook in the Background

Another thing to keep in mind:
In your code you can hide and unhide any workbook. This way you can unhide
the workbook and workwith it and than rehide it when finished. This way the
user will never see it or have access to it. And you might be able to use
xlVeryHidden to make sure that the user can't find it.

--
rand451
"g-boy" wrote in message
...
"George Nicholson" wrote:
Dim acts much like Private. If you want the variable to be recognized by
another module, use Public:
Public objApp As Excel.Application


Thank you... I didn't know that. I figured "dim" was generic, with
"Public"
and "Private" as special cases.

However, unfortunately *just* changing the declaration line to

Public objApp As Excel.Application

in the ThisWorkbook declaration didn't fix the problem... I still get an
"Object Required" error on the line:

Set DataSheet = objApp.Workbooks("Data.xls").Sheets(1)

in the code for the worksheet.

Could this be because one is declarated in the code for the workbook, but
the subroutine that uses the variable is in the code for the worksheet?
Do I
need to do something to explicitly declare the thing as "global" or
something?