Jump to content

Excel question...


Recommended Posts

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

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

  • Moderators

@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. 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

Link to comment
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
 Share

×
×
  • Create New...