CVI - Course excel files open "windows in.

Hello

I'm working on a project en CVI (8,0), who must deal with Excel files.

The problem is that my software don't control the file which is open: its name and its location are not known normal program.

My idea is to browse excel files open, to verify the presence of the characteristic for some characters in.

Normal however, I can't seem to find the fonctionns allowing me to browse these files in the Excel API.

My idea would be for example:

Lancer Excel (se connecter, avec le Excel_ActiveApp )
POUR chaque fichier ouvert FAIRE
     Lire contenu case 'A1'
     Si contenu == "toto" ALORS
        // C'est mon fichier
    SINON
        // C'est pas mon fichier
    FIN SI
FIN POUR

I tried searching with

Microsoft Excel 14.0 object library

and

Microsoft Excel 9.0 Object Library

I have not found.

So I'm looking for help,

Thanks in advance,

Cédric.

I find the solution here:

http://www.theusenetarchive.com/Usenet-message-CVI-and-Excel-Help-11429335.htm

This modified callback in excel2000dem sample project lists all opened files in Excel:

//----------------------------------------------------------------------------
// ConnectApp
//----------------------------------------------------------------------------
int CVICALLBACK ConnectApp (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
long ExcelWorkbooksCount;
HRESULT error = 0;
int i;
char *ExcelWorkbookName;

switch (event)
{
case EVENT_COMMIT:
// Launch App
// Connect to existing application if available
SetWaitCursor (1);
error = Excel_ActiveApp (NULL, 1, LOCALE_NEUTRAL, 0, &ExcelAppHandle);
SetWaitCursor (0);
if (error<0)
goto Error;

// Make App Visible
error = Excel_SetProperty (ExcelAppHandle, NULL, Excel_AppVisible, CAVT_BOOL, appVisible?VTRUE:VFALSE);
if (error<0)
goto Error;

// Get number of open files
error = Excel_GetProperty (ExcelAppHandle, NULL, Excel_AppWorkbooks, CAVT_OBJHANDLE, &ExcelWorkbooksHandle);
if (error < 0) goto Error;
error = Excel_GetProperty (ExcelWorkbooksHandle, NULL, Excel_WorkbooksCount, CAVT_LONG, &ExcelWorkbooksCount);
if (error < 0) goto Error;

// Iterate through files and get file name
for (i = 1; i <= ExcelWorkbooksCount; i++) {
error = Excel_WorkbooksItem (ExcelWorkbooksHandle, NULL, CA_VariantInt(i), &ExcelWorkbookHandle);
if (error<0)
goto Error;
error = Excel_GetProperty (ExcelWorkbookHandle, NULL, Excel_WorkbookName, CAVT_CSTRING, &ExcelWorkbookName);
// Print file name
DebugPrintf ("Workbook %d: %s\n", i, ExcelWorkbookName);
// Free resources
ClearObjHandle (&ExcelWorkbookHandle);
CA_FreeMemory (ExcelWorkbookName);
if (error<0)
goto Error;
}

UpdateUIRDimming(panelHandle);
MakeApplicationActive ();
excelLaunched = 0;
break;
}
return 0;
Error:
if (error < 0)
ReportAppAutomationError (error);

return 0;
}

Tags: NI Software

Similar Questions

  • How to make an excel file opens automatically whenever I start my computer? ___

    How to make an excel file opens automatically whenever I start my computer?

    Put a shortcut to the file in your startup folder.

  • check if excel file open

    Hallo,

    How can I check if an excel file is opened or not opened. I need a code for the script of DIAdem.

    Thank you

    You can use code like this to ensure that a file is accessible exclusively.

    Option Explicit

    protected xlsxFile: xlsxFile = "C:\temp\out_EXPORT.xlsx".
    MsgBox FileAccessible (xlsxFile)

    function FileAccessible (byref filePath)
    FileAccessible = FALSE
    Dim fh: fh = TextFileOpen (filePath, eTextFileAttributeExclusive GOLD eTextFileAttributeRead GOLD eTextFileAttributeANSI)
    <>FH then
    call TextFileClose (fh)
    FileAccessible = TRUE
    end if
    EndFunction

  • More than 1 file open Excel, Aero Peek will show not miniature, only circles

    Since the critical update from Microsoft last week (26/02/13), when I have more than one file opened in Excel, all I get in the vignettes are circles.  I restored in time before the update and the Aero Peek normally carried out with more than one Excel file is open.  The feature works with more open file in Word, MapPoint and Outlook (all open at the same time).  If there is only a single Excel file open, the Aero Peek thumbnail runs as it should.  The file names appear again, but only spinning circles on the tile.

    Hello

    Thanks for the reply.

    I would like to create a new user account and check if that helps.

    Create a user account: http://windows.microsoft.com/en-IN/windows7/Create-a-user-account

    If the problem does not occur in the new user account, you can transfer the files from the damaged to the new user account by using the article user account "difficulty a user profile is corrupted.

    Difficulty a user profile is corrupted: http://Windows.Microsoft.com/en-us/Windows7/fix-a-corrupted-user-profile

    Thank you.

  • The download window - behavior on the selection of the Excel window open excel files

    Imagine that you are working on an Excel file. You have completed and saved. You leave open and want to download it via Firefox - whether for a portal, or to send an email or anything else.
    As soon as any Excel file is selected in the window of the Explorer/upload (be it by single click or highlighting by the arrows), Excel window is set up to forward - as if I had clicked on the icon in the taskbar.

    I can't make pile or face of this - it seems to be only Excel.
    It's pretty frustrating in itself and especially when needing to download several Excel files.

    Any ideas?

    Guigs2, you understand.

    COR - el, Yes, it happens only when Excel is already running. He does not Excel if Excel is not running.

    Update: now it no longer. I have no idea what has changed. I have probably quit Firefox, I killed all the process of Excel running, or just rebooted.

    I uninstalled the Flash plugins and installed the latest version.
    If the problem occurs again, I will try it in safe mode.

    Thanks for your help so far!

  • Whenever I open an Excel file, I get a pop for Windows Installer

    Original title: Windows Installer

    Every time I open an existing Excel file, Windows Installer opens first, there is a significant delay and opens the Excel file. What is the solution to get out of the process of opening Excel from Windows Installer files? I don't see Windows Setup in the control panel so I can't remove it.

    Thank you

    Hi Phil,

    Windows Installer tries to configure excel on your system.

    Click Start-> settings-> Control Panel-> Add/Remove Programs-> Microsoft office-> change-> add/remove component-> select excel, then click on run from my computer.

    Once its finished installation-> start excel from start-> programs-> excel (or in Microsoft office-> Excel).

    Let the full installation. Close excel and open your files.

    I hope this helps.

  • Word or excel file does not open on gives Vista error: windows cannot open c:\users... Make sure you typed the name correctly and try again.

    Word or excel file does not open on gives Vista error: windows cannot open c:\users... Make sure you typed the name correctly and try again.

    Whenever I click on a word or document it opens excel excel but it gives an error message: windows cannot open c:\users... Make sure you typed the name correctly and try again.

    I can open the document that after selecting the file only in excel or word blank document by clicking on the windows logo & choose the file and click on open.

    I need immediate assistance. I tried windows service pack 2 updates, but nothing works. Can anyone help?

    Please repost your question in the Discussion of the Office group at: http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.office.misc&lang=en&cr=US where the Word and Excel experts will be more than happy to help you with your problem.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Have windows 7 installed and office 2007. Cannot open the old excel files. Error reading .xlsx is not a valid Win32 application

    Have a new laptop with Windows 7. Responsible for Office 2007. Cannot open the old Excel files. Get the error reading .xlsx is not a valid Win32 application when I try to open the file.

    Right-click on the Xlsx file and select open with.  Then find Excel and make sure that it is selected to always open with this program.  Click OK, and then see if it works

  • Problems with the opening of attachments when the user has restristed privilege to run executable code from Program Files and Windows folders.

    I'm trying to prevent users from running potentially dangerous files. According to the Windows policies so I put. Users can run any application Program Files, files (x 86), windows, and folder to all users of the program office. Users have no permission to write anything in this files. When the user double clicks for example document.doc on his desk - document opens fine with MS Word. But when the user tries to open this document in attachment directly (by selecting open with MS Word, instead of the economy) - he sees an error - "this action is limited by local politics. Ask your system administrator. "(not exact text).

     So I want, users able to open attachments from Thunderbird automatically, but not able to run any application or link, except Program Files, Program Files (x86), Windows and all users' desktop folder. How can I get this result?
    

    Thanks in advance.
    Calvo is serious.

    PS Sorry for my bad English. It is not my mother tongue.

    Thanks for responding.
    I discovered what was going on.
    This strange "bug" affects multiple computers with Windows 7 Ultimate in my case.
    When you create a SRP (software restriction policies) it creates two rules by default to run programs: windows folder and the Program Files folder. I manually add "C:\Program Files (x 86)" in places without restriction. BUT Windows and Program Files folder to default rules directly, but through registry keys. And this part seems difficult. You CAN run the executable files of Program Files. You CAN run the Program Files (x 86) executables. But if Thunderbird or Firefox try to run MS Word or excel or editor for.doc or *.odt opening or another file - downloaded files running programs blocked by SRP.
    In order to fix this, simply replace the rules for indirect paths like % HKLM/software/microsoft/windows... etc % with direct, for example "C:/Windows" and "C:/Program Files /". After that, everything works fine. Attachments and downloaded files automatically opens without a problem.

  • Open the front panel Excel file

    I tried to open an existing to open the front panel button... excel file but looking in the forum I found two examples... attached... done with the document word and another notebook... However I am unable to do it with excel...

    In the second example that uses Sysexec.vi... I tried to enter the path of excel file... but it does not open... but same file opens when I write it on 'Run' in windows vista...

    Advisor...

    I found the solution... using sysexec.vi and the command line...

    Thank you...

  • Open a word with extn docx file using windows xp 2002

    My home PC's with windows XP 2002. Documents received in the version other than the 2002 version and above could not be opened. Please help me to open a word with extn (.docx) file using windows xp 2002

    If you have an earlier version of Word installed:

    Microsoft Office for Word, Excel, and PowerPoint File Formats Compatibility Pack

    To view, print and copy most recent Word documents, even if you don't have Word installed:

    Word Viewer

    John

  • Open Excel files separate side by side on double moniors in Microsoft Office 10

    How to open Excel files separate side by side on double moniors in Microsoft Office 10

    Hello

    I suggest you to refer to the section to move items between monitors of the link.

    How to configure and use multiple monitors in Windows XP.

    http://support.Microsoft.com/kb/307873

    Drag additional Excel files to the second moniter and check

    If the problem is specific to the office then post this question in the forum office.

    http://answers.Microsoft.com/en-us/Office/Forum/Outlook

  • When open my photo album file and clicking on a photo to see the excel program opens the image viewer.

    I open an email with pictures.  When I click on the photo attached to the view, the excel program opens and not the image viewer.

    One of photo accessories save somewhere you can find it (for example, your desktop computer).
    Right-click on the file that you saved and select open with, then select "Choose program" (at the bottom of the context menu).

    If the program you want to use is listed as one of the "recommended programs", select it, click on the box to "Always use the selected program to open this kind of file" and click OK.

    If you want to use the Windows Picture and Fax Viewer to view photos (personally, I like free IrfanView better) AND it is NOT listed as a program "recommended" or under "Other programs", follow the instructions below:

    in Windows Explorer:

    • On the Tools menu, click folder... Options
    • Click the File Types tab.
    • Scroll down to the extension that you like, for example "JPG".
    • Press the restore button, if it exists.
    • Press the Advanced button.
    • Click the Open action.
    • Click on change...
    • In the Application used to perform action: enter C:\WINDOWS\system32\rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen %1. "C:\WINDOWS" is the directory that contains your Windows installation.
    • Press OK

    You'll want to repeat for each extension (GIF, JPG, JPEG, etc.) for which you want to change the behavior.

  • Problem opening Excel files through shortcuts

    I had a problem with Excel and Vista I can not back down to the coast. A lot of research but can not find an answer. I tried saving the file associations for Excel but doesn't seem to be the cause of the route of the question.

    Problem...
    If I open an Excel file in Excel 2007, all is well. However if I try to open the same file by double clicking it from the Explorer or Office Excel reports an error that the file cannot be found. The same problem does not occur with a different username on the same installation on Vista.

    Any ideas?

    Jonas

    JonasHjerpe says:

    I had a problem with Excel and Vista I can not back down to the coast. A lot of research but can not find an answer. I tried saving the file associations for Excel but doesn't seem to be the cause of the route of the question.

    Problem...
    If I open an Excel file in Excel 2007, all is well. However if I try to open the same file by double clicking it from the Explorer or Office Excel reports an error that the file cannot be found. The same problem does not occur with a different username on the same installation on Vista.

    Any ideas?

    Jonas

    See if this helps:

    1. Start Microsoft Excel.
    2. On the Tools menu, click Options.
    3. On the general tab, clear (uncheck) ""ignore other applications ' and then click OK. "
    4. Quit Excel.

    [If this post can help solve your problem, click on the button 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]
    Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003

  • Windows 7 search did not find the result of a formula in excel file

    Hello

    I have some files stored in a folder specific excel. In excel files, there are some formulas. Windows search, I want to find the file that shows the result of a particular formula. When I search, it not find the file with the text, the result of the formula. Can someone help me please?

    Windows cannot do this, because the formula has not been assessed or calculated yet.  Only Excel can calculate the result of the formula and show the answer, so you must open the file in Excel before you can find the result.

Maybe you are looking for

  • Need help to install itunes on my computer

    Need help to install itunes on my computer.  I get an error message from itunes64setup.exe is not a valid win32 application

  • Download black screen during installation of Windows 7 from the disk.

    Original title: loading Windows 7 with windows 8 is already installed Dell computer brand new.  (Terrible dealer. They charge $ for help on something other than the material.)  The new computer comes with windows 8 is installed. Like any windows 8. 

  • BlackBerry Blackberry Curve 8900 Smartphones - access to App World error

    Hello Can someone help me? I went to my network provider, but they are without help. I downloaded with worldwide success of blackberry app on my blackberry but it says I need to upgrade to a plan that includes browsing. I have web access if im not su

  • Insert the movie in dreamweaver cm³

    HelloI try to insert a movie (MOV, AVI or MPEG4) in Dreamweaver CM³,and every time appears the following message: "could not load the plug-in.How can I solve this problem?I am to convert the original. MOV to AVI and MPEG4 with Adobe encoder support.M

  • 11.1.2.1 EAS Web console error

    HelloI am trying to connect to EA via Web 11.1.2.1 console but are "authentication error failure" in the system where Java 7 update 5 is installed.I am able to connect from the system where Java 6 is installed,What EAS 11.1.2.1 is compatible with Jav