operating notepad from VBA

  • Thread starter Thread starter pm
  • Start date Start date
P

pm

hello,

how can i
1. open notepad,

shell ?

2. paste excel range as value into notepad

3. save notepad as html

4. close notepad

?

or do it with create object ?

thank for suggestion.

rgs
 
Shell will do it.

Perhaps you have some kind of "super" Notepad, but mine has no "save as
HTML" function...
 
I'm curious why you'd want to go through all those gyrations with Notepad when
Excel allows you to save as html directly? And Notepad doesn't...

Bill
 
Bill said:
I'm curious why you'd want to go through all those gyrations with Notepad when
Excel allows you to save as html directly? And Notepad doesn't...

i build all code in excel..

when saving excel as html you get each sheet as different subpage in html, moreover
excel saves too much unnecessary styles and tags - i want to have control what i get
in html code..

i use such a code:

Sub notepad()
Application.ScreenUpdating = False

Dim FF As Integer
Dim plik As String
Dim tekst As String
Dim kom As Range

plik = "C:\Documents and Settings\user\Pulpit\webpage1.html"
FF = FreeFile
Open plik For Output As #FF
For Each kom In Sheets("prob").Range("A1:B16088")
tekst = kom.Text
Print #FF, tekst
Next
Close #FF

Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top