Results 1 to 3 of 3

Thread: [RESOLVED] Excel 20020 VBA

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330

    Resolved [RESOLVED] Excel 20020 VBA

    I had a nice little excel module that ran with out a hitch in Excel 2000, I recently obtained a new Pc and with Excel 2002 on it and the module no longer works. It is stuck on the open method.

    ChDir "Drive & folder"
    Workbooks.Open "Drive & Folder & Filename"

    Says method Open of object workbooks failed.

    I can not figure this out.

    Swoozie
    Swoozie
    Somedays you just should not get out of bed.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    <<ChDir "Drive & folder"
    Workbooks.Open "Drive & Folder & Filename">>


    This code will not work. You need to supply the correct path and filename as a string.
    eg. MyFullName = "C:\TEMP\" & "myfile.xls"

    You may also need to change the *drive* first with :-
    ChDrive MyFullName
    (The function automatically uses just the first letter of the string)
    Regards
    BrianB
    -------------------------------

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330
    Thanks for the input, however the issue lies not in the actual syntax but in the way Excel 2002 opens and checks for errors on files.

    Crystal Reports that have been exported to excel have messed up tab/worksheet names and excel 2002 automatically recognizes this fact and basically bombs out with code.

    I tried opening it using various methods but it still checks for errors. My only option at this point is to export the report in a different format and copy in thru code to excel and continue my processing.

    More code

    Swoozie
    Somedays you just should not get out of bed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width