View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid vezerid is offline
external usenet poster
 
Posts: 751
Default Using cell value in filenames

Neil,

thanks for the feedback. Let me clarify some things further:

The Filename:=x
expects a string for x. The assignment made here is actually

Filename:=Range("A1").Value

Value is the default property of the Range object that it could be
omitted. The expression Range("A1") refers to an object, which is not
the proper data type for this assignment. If you wanted to assign
Range("A1") to an object variable you would need

Dim rng as Object 'or Dim rng as Range
Set rng = Range("A1")

Access VBA works in the same manner re objects and simple data types.
The online documentation clarifies these things. WHen in the VBA IDE
just click on the work SaveAs and press F1. From there you will start
seeing how the object libraries work.

HTH
Kostis