+ Reply to Thread
Results 1 to 2 of 2

Run Time Error 1004 pasting formula into worksheet using VBA.

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Run Time Error 1004 pasting formula into worksheet using VBA.

    Hi,

    I have this piece of code which is giving me an run-time error "1004". I think i figured out the problem but wanted to ask


    The vba code is as follows to insert a formula into a specific workbook-worksheet-cell locastion:
    Please Login or Register  to view this content.
    in the example code above let x=1



    Now the strange thing is that if the

    fl_new = "Copy of empty_4_4_notemptyNewemptyOld_DET.xlsm" CODE FAILS


    fl_new = "tst_4_4_Junk_DET.xlsm" CODE DOES NOT FAIL


    So i have narrowed down the problem to the file-name. I manually opened the failing file and manually typed in this formula

    Please Login or Register  to view this content.
    and it took it.......again i manually did this not using vba.............



    ANY IDEAS why using VBA in the manner i did would cause this problem?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Run Time Error 1004 pasting formula into worksheet using VBA.

    Trying to use code on workbooks that are in the temp folder sucks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1