Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:29:28+00:00 2026-06-14T00:29:28+00:00

I have the following function doing what I want it to do, except that

  • 0

I have the following function doing what I want it to do, except that instead of generating the chart on a new worksheet I would like to embed it in the worksheet where the data is written. Also, how can I remove the legend? Here is what I’ve got:

def Get_IV_Data(current_file):

    xlApp = win32com.client.Dispatch('Excel.Application')
    xlApp.Visible = True

    xlBook = xlApp.Workbooks.Add()

    xlSheet = xlBook.Sheets(1)
    xlSheet.Name = filename

    for i in range(0, 10):
        fluff = current_file.readline()

    Input_Parameters = fluff.split("\t")

    from operator import itemgetter
    Cal_Std_V = float(itemgetter(2)(Input_Parameters))

    xlSheet.Cells(1,1).Value = "V"
    xlSheet.Cells(1,2).Value = "I"
    xlSheet.Cells(1,3).Value = "P"

    output_line = 2

    # Assign the data to lists

    for line in current_file:
        try:
            a = line.split("\t")
            STD1, STD2, STD3, V, I, Vcorr, Icorr, v1, v2, v3 = a
            I = round(float(I) * (Cal_Std_V / float(STD1)), 6)
            P = round(float(V) * I, 3)
            xlSheet.Cells(output_line, 1).Value = V
            xlSheet.Cells(output_line, 2).Value = I
            xlSheet.Cells(output_line, 3).Value = P
            output_line += 1

        except ValueError:
            pass

    chart = xlApp.Charts.Add()
    chart.Name= "Plot "+xlSheet.Name
    series = chart.SeriesCollection(1)
    series.XValues= xlSheet.Range("A2:A200")
    series.Values= xlSheet.Range("B2:B200")
    series.Name= filename
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:29:29+00:00Added an answer on June 14, 2026 at 12:29 am

    Set the location of a Chart by calling its Location method, which takes two parameters.

    The first is called Where, which takes an enumeration with names xlLocationAsNewSheet, xlLocationAsObject, and xlLocationAutomatic having values of 1, 2, and 3 respectively.

    The second parameter is Name, which is a worksheet name.

    Here is that in Python:

    xlLocation = {"AsNewSheet": 1,
                  "AsObject": 2,
                  "Automatic": 3 }
    chart.Location(xlLocation["AsObject"], xlSheet.Name)
    

    If you prefer magic numbers you can change that to

    chart.Location(2, xlSheet.Name)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following function that works properly, except for when you use the
I have the following function that works properly in Chrome and Firefox, but not
I want to create a function with the signature seq<#seq<'a>> ->seq<seq<'a>> that acts like
I want the following function to validate a string if it looks like this:
All, I have the following bit of code: function addPoints() { newpoints[0] = new
I have following function in one Activity public void AppExit() { Editor edit =
In my MVC application in Controller i have following function to add and focus
have the following function on my collection : getFiltered: function (status, city) { return
I have the following function set up to sequentially fade in divs (with class
I have the following function to remove a DOM element div, $('#emDiv').on(click, ':button[data-emp-del=true]', function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.