Question

I am recording a simple macro that creates a data graph using two columns. When I...

I am recording a simple macro that creates a data graph using two columns. When I run the macro code I keep getting the following error:

Run-time error '1004':

The formula you typed contains an error.• To get assistance in entering a function, click OK,then click Function on the Insert menu. • If you are not trying to enter a formula, avoid using an equal sign (=) or minus sign (-), or precede it with a single quotation mark (').

Here is the VB code:

Sub Macro4()
'
' Macro4 Macro
'
' Keyboard Shortcut: Option+Cmd+p
'
    Range("A1:B39").Select
    ExecuteExcel4Macro (FALSE,240,73)
    ActiveChart.SetSourceData Source:=Range("'5E627659 host-260'!$A$1:$B$39")
End Sub

I'm running Excel 2016 for Mac. When I try the same thing on a Windows machine, it works.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans: Put a '.' before range and make sure that you should have an updated version.

ActiveChart.SetSourceData Source:=.Range("'5E627659 host-260'!$A$1:$B$39").

It will works fine

You cann even use this::

//ActiveChart.SetSourceData Source:=Sheets("Data").Range("'5E627659 host-260'!$A$1:$B$39")//

//Thank you//

Add a comment
Know the answer?
Add Answer to:
I am recording a simple macro that creates a data graph using two columns. When I...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT