FrancescoDiMuro

Excel question...

6 posts in this topic

#1 ·  Posted (edited)

Hi guys! How are you? Hope you're fine :)
I've been using Excel UDF for a while, and I always wanted to post this question:
"Why, everytime I set the paramter $bVisible = False of the _Excel_Open() function, IF I HAVE AN EXCEL SHEET OPENED, I still can see the Excel opening and doing what I wrote in the script? And, in this case, how can I avoid this?"
Thanks :) 

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites



@FrancescoDiMuro You mean you have one excel sheet open already, and you're opening a different one through your script? 

If I have 1.xlsx open on my desktop, and use the code below:

#include <Excel.au3>

;1.xlsx opened manually and visible

Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\2.xlsx")

the excel object (and thus the sheet) is hidden, as I would expect it to be. 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

@JLogan3o13
Good morning buddy!
Thanks for the reply :)

I used ( and I would like to use again ) Excel UDF to create Export ( I looked at Word UDF too, I'm going to explain soon my "I would like to..." :D ) files, but everytime I have an Excel sheet opened, and I do some management with Excel UDF, sheets appears and show what I set to do with my sheet. It's a strange thing, I don't know why it does occur... 
Talking about Word UDF, I have a 2D array ( returned by a ListView ), and I would like to create a report with this array, inside a Word table... I tried with this, but texts are a bit untidy... Can you help me out, please? :) 
 

Local $oWord = _Word_Create(False)
            If @error Then
                MsgBox($MB_ICONERROR, "Errore!", "Errore durante la creazione dell'oggetto Word." & @CRLF & "Errore: " & @error)
            Else
                ; The field alreay exists, but would be nice if I can create it... I thought at _FileCreate() :) 
                Local $oDoc = _Word_DocOpen($oWord, $sCartellaModelli & "\Esportazione_Modello.doc")
                If @error Then
                    MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'aggiunta di un nuovo documento Word." & "Errore: " & @error)
                Else
                    Local $oRange = _Word_DocRangeSet($oWord, 0)
                    If @error Then
                        MsgBox($MB_ICONERROR, "Errore!", "Errore durante il settaggio del range nel documento Word." & @CRLF & "Errore: " & @error)
                    Else
                        _Word_DocTableWrite($oRange, $aListView, Default)
                        If @error Then
                            MsgBox($MB_ICONERROR, "Errore!", "Errore durante la creazione della tabella." & @CRLF & "Errore: " & @error & "Informazioni: " & @extended)
                        Else
                            _Word_DocSaveAs($oDoc, $sCartellaEsportazioni & "\Esportazione_di_prova.doc")
                        EndIf
                    EndIf
                EndIf
            EndIf

And this is the actual result:
Cattura.PNG


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

Ok, so are you looking for help with the Excel issue or the Word issue? You are bouncing around a bit. Choose one issue and we can try to troubleshoot with you.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

@JLogan3o13
Sorry for my bad explanation :)
I would like to have help on Word UDF at the moment, thanks :) 


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites
7 hours ago, FrancescoDiMuro said:

I would like to have help on Word UDF at the moment, thanks

Open a new thread, you're confusing things by referencing Excel and Word problems in the same thread when they're unrelated issues.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • LoneWolf_2106
      By LoneWolf_2106
      Hi everybody,
      i have to store an entire row of a Excel workbook into an array.  The row index is stored in a variable.
      How can i do it?
      Thanks in advance for your support.
    • LoneWolf_2106
      By LoneWolf_2106
      Hi everybody,
      i have to write a value into an excel column.
      I know where it starts from, but i don't know what the end is, last non-empty cell.
      How can i get the number of last non-empty cell?
      Thanks in advance.
      Regards 
    • Nareshm
      By Nareshm
      Hi All,
      I have excel file like this
      and i want to cut cell/text from excel to other software.

       
      I have to cut the cell of B column one by one and past into other software
      If Winexists("No Data Found")
      then restore cuted cell and goto next/down side cell
      How to do it ?
    • water
      By water
      Extensive library to control and manipulate Microsoft Excel charts.
      Theads: General Help & Support - Example Scripts
      BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort

      KNOWN BUGS (last changed: 2017-07-21)
      None. The COM error handling related bugs have been fixed.
       
    • Mag91
      By Mag91
      Hey Community,
      cause im too new in the Auto it world i will try it with the your help. hopefully.
      I woud like to know how i can handle my Problem.
      ----
      I have a Excel Data with 362 random numbers.
      For Example:
      1166642335374 1172899897343
      .....
      this numbers are a part of the filepath ...example
      D:\Projekte\1166_64233_5374
      as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
      This is my first question. How can i handle this to make it Shell execute.
       
      --------
      Second question:
      If i am in the path.
      For Example:
      D:\Projekte\1166_64233_5374
      the code shoud search for specific PDF Files.
      They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
      the first 15 letters are always the same
      0050569E364B1ED
      when he found this data he has to copy it on a Folder on the Desktop.
      (There can also be 2 or 3 pdfs in one Folder with this letters)
      ----
      Please give me some help :-)