Text Formatting ⇒ open and compile a tex document from another program
open and compile a tex document from another program
I am pretty new to this community and LaTex itself. I have created an Excel macro that is used to collect employee info and it writes out a .tex file. what I am trying to do and not being able is to compile the .tex file by calling the latex compiler from within Excel. I am a windows user and have been using LED and/or Texnic Center
any help will be greatly appreciated.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 274
- Joined: Fri Feb 05, 2010 10:15 pm
Re: open and compile a tex document from another program
I have never heard of excel being able to compile a latex file. I know you can save excel files as .csv and use them in some packages (pstricks).
Nick
Re: open and compile a tex document from another program
Thanks for your reply. I am not compiling the .tex file with Excel

I can open .tex compilers such as LED or Texnic center manually and compile the file I write out but I am trying to open the compilers using Excel macro and have it compiled automatically os that the whole process can be automated.
Hope I am making more sense here

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: open and compile a tex document from another program
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
open and compile a tex document from another program
Problem with Excel than with LaTex... well Yes and No. I used Excel to get the .tex file written out. Then I tried running LaTex compiler from within Excel. So, I would say it is a kind of combined problem.
But I got it figured out. This is what I did:
- Write the .tex file (properly formatted from Excel)
- Called a batch file pdfLaTex.bat from Excel using "Shell" as follows:
Code: Select all
program = pdflatexbatfile & " " & directory & " " & texfilename
TaskID = Shell(program, 1)
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
open and compile a tex document from another program
I don't think so. The generated source file compiles smoothly. The only problem is to call a LaTeX compiler from within Excel. So, clearly not a LaTeX problem.mpaudel wrote:[…] Problem with Excel than with LaTex... well Yes and No. I used Excel to get the .tex file written out. Then I tried running LaTex compiler from within Excel. So, I would say it is a kind of combined problem. […]
Nevertheless, if the problem is solved with that, please mark the topic (not the last post) accordingly.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
open and compile a tex document from another program
However, could you please let me know, how you write into a .tex file in the first place
Plus please explain the Dim of the variables used since I'm not sure what `pdflatexbatfile` should be declared as (as well as program)